Interface CellDistanceFunction

All Known Implementing Classes:
BorderDistanceFunction, DirectGrid, GridCellDistanceFunction, HexCellDistanceFunction

public interface CellDistanceFunction
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    collect(int originalSeed, int seed, int minX, int minY, int maxX, int maxY, ResultBuffer.Bounds2d bounds, T ctx, PointConsumer<T> collector, PointEvaluator pointEvaluator)
    Iterate the cell-grid between the two provided corner coordinates and collect the cell centre-points of each cell visited.
    void
    evalPoint(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
    Evaluate distance to the given cell centre-point recording only the closest result.
    void
    evalPoint(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
    Evaluate distance to the given cell centre-point recording only the closest result.
    void
    evalPoint2(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
    Evaluate distance to the given cell centre-point recording the closest and second-closest result.
    void
    evalPoint2(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
    Evaluate distance to the given cell centre-point recording the closest and second-closest result.
    default int
    getCellX(double x, double y)
    Get the x-index of the cell that point x,y is inside.
    default int
    getCellX(double x, double y, double z)
    Get the x-index of the cell that point x,y,z is inside.
    default int
    getCellY(double x, double y)
    Get the y-index of the cell that point x,y is inside.
    default int
    getCellY(double x, double y, double z)
    Get the y-index of the cell that point x,y,z is inside.
    default int
    getCellZ(double x, double y, double z)
    Get the z-index of the cell that point x,y,z is inside.
    default double
    invScale(double value)
    Convert the provided coordinate component to the inverse scale of this CellDistanceFunction.
    void
    nearest2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
    Calculate the distance to the nearest cell centre-point of a 2D cell neighborhood.
    void
    nearest3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
    Calculate the distance to the nearest cell centre-point of a 3D cell neighborhood.
    default double
    scale(double value)
    Convert the provided coordinate component to the scale of this CellDistanceFunction.
    void
    transition2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
    Calculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.
    void
    transition3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
    Calculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.
  • Method Details

    • scale

      default double scale(double value)
      Convert the provided coordinate component to the scale of this CellDistanceFunction.
      Parameters:
      value - The coordinate component to scale.
      Returns:
      The coordinate component scaled to this CellDistanceFunction's domain.
    • invScale

      default double invScale(double value)
      Convert the provided coordinate component to the inverse scale of this CellDistanceFunction.
      Parameters:
      value - The coordinate component to scale.
      Returns:
      The coordinate component inversely scaled from this CellDistanceFunction's domain.
    • getCellX

      default int getCellX(double x, double y)
      Get the x-index of the cell that point x,y is inside.
      Parameters:
      x - The x-coordinate of the point.
      y - The y-coordinate of the point.
      Returns:
      The cell's x-index.
    • getCellY

      default int getCellY(double x, double y)
      Get the y-index of the cell that point x,y is inside.
      Parameters:
      x - The x-coordinate of the point.
      y - The y-coordinate of the point.
      Returns:
      The cell's y-index.
    • getCellX

      default int getCellX(double x, double y, double z)
      Get the x-index of the cell that point x,y,z is inside.
      Parameters:
      x - The x-coordinate of the point.
      y - The y-coordinate of the point.
      z - The z-coordinate of the point.
      Returns:
      The cell's x-index.
    • getCellY

      default int getCellY(double x, double y, double z)
      Get the y-index of the cell that point x,y,z is inside.
      Parameters:
      x - The x-coordinate of the point.
      y - The y-coordinate of the point.
      z - The z-coordinate of the point.
      Returns:
      The cell's y-index.
    • getCellZ

      default int getCellZ(double x, double y, double z)
      Get the z-index of the cell that point x,y,z is inside.
      Parameters:
      x - The x-coordinate of the point.
      y - The y-coordinate of the point.
      z - The z-coordinate of the point.
      Returns:
      The cell's z-index.
    • nearest2D

      void nearest2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
      Calculate the distance to the nearest cell centre-point of a 2D cell neighborhood.
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      cellX - The x-index of cell to evaluate around.
      cellY - The y-index of cell to evaluate around.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • nearest3D

      void nearest3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
      Calculate the distance to the nearest cell centre-point of a 3D cell neighborhood.
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      z - The y-coordinate being sampled.
      cellX - The x-index of cell to evaluate around.
      cellY - The y-index of cell to evaluate around.
      cellZ - The z-index of cell to evaluate around.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • transition2D

      void transition2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
      Calculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      cellX - The x-index of cell to evaluate around.
      cellY - The y-index of cell to evaluate around.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • transition3D

      void transition3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
      Calculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      z - The y-coordinate being sampled.
      cellX - The x-index of cell to evaluate around.
      cellY - The y-index of cell to evaluate around.
      cellZ - The z-index of cell to evaluate around.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • evalPoint

      void evalPoint(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
      Evaluate distance to the given cell centre-point recording only the closest result.
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      cellX - The x-index of cell being evaluated.
      cellY - The y-index of cell being evaluated.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • evalPoint

      void evalPoint(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
      Evaluate distance to the given cell centre-point recording only the closest result.
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      z - The y-coordinate being sampled.
      cellX - The x-index of cell being evaluated.
      cellY - The y-index of cell being evaluated.
      cellZ - The z-index of cell being evaluated.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • evalPoint2

      void evalPoint2(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
      Evaluate distance to the given cell centre-point recording the closest and second-closest result.
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      cellX - The x-index of cell being evaluated.
      cellY - The y-index of cell being evaluated.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • evalPoint2

      void evalPoint2(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
      Evaluate distance to the given cell centre-point recording the closest and second-closest result.
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      z - The y-coordinate being sampled.
      cellX - The x-index of cell being evaluated.
      cellY - The y-index of cell being evaluated.
      cellZ - The z-index of cell being evaluated.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • collect

      <T> void collect(int originalSeed, int seed, int minX, int minY, int maxX, int maxY, ResultBuffer.Bounds2d bounds, T ctx, PointConsumer<T> collector, PointEvaluator pointEvaluator)
      Iterate the cell-grid between the two provided corner coordinates and collect the cell centre-points of each cell visited.
      Type Parameters:
      T - The type of the contextual information being passed to the collector.
      Parameters:
      originalSeed - A seed from which child-seeds may be offset.
      seed - The seed used to determine cell centre-points.
      minX - The x-index of the inclusive lower corner of the cell region.
      minY - The y-index of the inclusive lower corner of the cell region.
      maxX - The x-index of the inclusive upper corner of the cell region.
      maxY - The y-index of the inclusive upper corner of the cell region.
      bounds - The bounds that generated points must be limited to.
      ctx - An arbitrary piece of contextual information to pass to the collector for each point visited.
      collector - A consumer for each visited cell centre-point.
      pointEvaluator - A function that evaluates each cell centre-point.