Class MarkWithPositionAndSingleRadius

Object
Mark
MarkWithPosition
MarkWithPositionAndSingleRadius
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Circle, Sphere

public abstract class MarkWithPositionAndSingleRadius extends MarkWithPosition implements Serializable
Base-class for a conic that has a single radius (circle, sphere etc.)
See Also:
  • Constructor Details

    • MarkWithPositionAndSingleRadius

      protected MarkWithPositionAndSingleRadius(Bound boundRadius)
      Constructor with a bound on the radius.
      Parameters:
      boundRadius - the bound for the radius
    • MarkWithPositionAndSingleRadius

      protected MarkWithPositionAndSingleRadius(MarkWithPositionAndSingleRadius src)
      Copy constructor.
      Parameters:
      src - the source object to copy from
    • MarkWithPositionAndSingleRadius

      protected MarkWithPositionAndSingleRadius()
  • Method Details

    • scale

      public void scale(ScaleFactor scaleFactor) throws CheckedUnsupportedOperationException
      Objects are scaled in pre-rotated position.

      So when aligned to axes, we actually scale in all 3 dimensions, and ignore scene-resolution

      Overrides:
      scale in class MarkWithPosition
      Parameters:
      scaleFactor - how much to scale by
      Throws:
      CheckedUnsupportedOperationException - when the scale-factor is not identical for the X and Y dimensions.
    • 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
    • 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
    • isPointInside

      public final 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
    • quickOverlap

      public Optional<QuickOverlapCalculation> quickOverlap()
      Description copied from class: Mark
      Provides an optional quick overlap calculation method.
      Overrides:
      quickOverlap in class Mark
      Returns:
      an Optional containing a QuickOverlapCalculation, or empty if not available
    • 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
    • equalsDeep

      public boolean equalsDeep(Mark mark)
      Description copied from class: MarkWithPosition
      Checks if this mark is equal to another mark by comparing all attributes.
      Overrides:
      equalsDeep in class MarkWithPosition
      Parameters:
      mark - the mark to compare with
      Returns:
      true if the marks are equal, false otherwise
    • strMarks

      public String strMarks()
      Returns a string representation of the mark's attributes.
      Returns:
      a string containing the radius value
    • setRadius

      public void setRadius(double radius)
      Sets the radius of the mark.
      Parameters:
      radius - the new radius value
    • radiusForRegion

      protected double radiusForRegion(int regionID)
      Calculates the radius for a specific region.
      Parameters:
      regionID - the ID of the region
      Returns:
      the radius for the specified region
    • radiusForRegionSquared

      protected double radiusForRegionSquared(int regionID)
      Calculates the squared radius for a specific region.
      Parameters:
      regionID - the ID of the region
      Returns:
      the squared radius for the specified region
    • getRadius

      public double getRadius()
    • getBoundRadius

      public Bound getBoundRadius()