Class RotatableBoundingBox

Object
Mark
MarkWithPosition
RotatableBoundingBox
All Implemented Interfaces:
Serializable

public class RotatableBoundingBox extends MarkWithPosition
A two-dimensional bounding-box rotated at arbitrary angle in XY plane around a point.

Axis-aligned bounding boxes are also supported by fixing orientation.

Author:
Owen Feehan
See Also:
  • Constructor Details

    • RotatableBoundingBox

      public RotatableBoundingBox()
      Creates a new RotatableBoundingBox with default values.
  • Method Details

    • isPointInside

      public byte isPointInside(Point3i point)
      Description copied from class: Mark
      Determines if a point is inside the mark.
      Specified by:
      isPointInside in class Mark
      Parameters:
      point - the point to check
      Returns:
      a byte representing the region membership of the point
    • update

      public void update(Point2d distanceToLeftBottom, Point2d distanceToRightTop, Orientation orientation)
      Updates the bounding box with new dimensions and orientation.
      Parameters:
      distanceToLeftBottom - the distance to the left-bottom corner
      distanceToRightTop - the distance to the right-top corner
      orientation - the orientation of the bounding box
    • boxAllRegions

      public BoundingBox boxAllRegions(Dimensions dimensions)
      Description copied from class: Mark
      Calculates the bounding box for all regions of the mark.
      Specified by:
      boxAllRegions in class Mark
      Parameters:
      dimensions - the dimensions of the space
      Returns:
      the bounding box
    • box

      public BoundingBox box(Dimensions dimensions, int regionID)
      Description copied from class: Mark
      Calculates the bounding box for a specific region of the mark.
      Specified by:
      box in class Mark
      Parameters:
      dimensions - the dimensions of the space
      regionID - the ID of the region
      Returns:
      the bounding box
    • volume

      public double volume(int regionID)
      Description copied from class: Mark
      Calculates the volume of a specific region of the mark.
      Specified by:
      volume in class Mark
      Parameters:
      regionID - the ID of the region
      Returns:
      the volume of the region
    • duplicate

      public Mark duplicate()
      Description copied from class: Mark
      Creates a duplicate of this mark.
      Specified by:
      duplicate in class Mark
      Returns:
      a new Mark instance that is a copy of this one
    • numberRegions

      public int numberRegions()
      Description copied from class: Mark
      Returns the number of regions in this mark.
      Specified by:
      numberRegions in class Mark
      Returns:
      the number of regions
    • getName

      public String getName()
      Description copied from class: Mark
      Returns the name of this mark type.
      Specified by:
      getName in class Mark
      Returns:
      the name of the mark
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • numberDimensions

      public int numberDimensions()
      Description copied from class: Mark
      Returns the number of dimensions of this mark.
      Specified by:
      numberDimensions in class Mark
      Returns:
      the number of dimensions
    • scale

      public void scale(ScaleFactor scaleFactor) throws CheckedUnsupportedOperationException
      Description copied from class: Mark
      Scales the mark in X and Y dimensions.
      Overrides:
      scale in class MarkWithPosition
      Parameters:
      scaleFactor - how much to scale by
      Throws:
      CheckedUnsupportedOperationException - if scaling is not supported for this mark type