Interface AccessObjectMask<T>

Type Parameters:
T - element-type, either an object-mask or has an object-mask representation.
All Known Implementing Classes:
AccessObjectMaskSimple

public interface AccessObjectMask<T>
Provides functions to provide access and creation to/from the object-mask representation of a generic type.

The purpose is to allow both ObjectMask and other types that may contain a ObjectMask to be scaled, with generic functions providing access and creation to/from the object-mask representation.

Author:
Owen Feehan
  • Method Summary

    Modifier and Type
    Method
    Description
    default BoundingBox
    boundingBoxFor(T element)
    A bounding-box for a given element.
    clipTo(T element, Extent extent)
    Ensures the element lies within a certain extent.
    createFrom(int index, ObjectMask object)
    Creates an element of type T from an object-representation and index.
    objectFor(T element)
    An object-mask for a given element.
    shiftBy(T element, ReadableTuple3i quantity)
    Positionally-shifts an element by a given quantity in the positive direction.
  • Method Details

    • objectFor

      ObjectMask objectFor(T element)
      An object-mask for a given element.

      This operation is assumed to involve negligible computational cost.

      Parameters:
      element - the element.
      Returns:
      the object-mask.
    • shiftBy

      T shiftBy(T element, ReadableTuple3i quantity)
      Positionally-shifts an element by a given quantity in the positive direction.
      Parameters:
      element - the element to shift by.
      quantity - the quantity to shift by.
      Returns:
      a newly created element based on element but positionally-shifted.
    • clipTo

      T clipTo(T element, Extent extent)
      Ensures the element lies within a certain extent.
      Parameters:
      element - the element.
      extent - the extent to clip to.
      Returns:
      either a newly created element or the existing element (if no change needs to occur).
    • createFrom

      T createFrom(int index, ObjectMask object)
      Creates an element of type T from an object-representation and index.
      Parameters:
      index - the index of the object-representation in terms of the original list.
      object - an object-representation corresponding to this index.
      Returns:
      a newly created element corresponding to the object-representation.
    • boundingBoxFor

      default BoundingBox boundingBoxFor(T element)
      A bounding-box for a given element.

      This operation is assumed to involve negligible computational cost.

      Parameters:
      element - the element.
      Returns:
      the bounding box.