Class Polygon

All Implemented Interfaces:
Serializable

public class Polygon extends PointListBase
Represents a polygon in 2D space as a Mark.
See Also:
  • Constructor Details

    • Polygon

      public Polygon()
  • 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
    • 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
    • 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
    • toString

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

      public void scale(ScaleFactor scaleFactor) throws CheckedUnsupportedOperationException
      Description copied from class: Mark
      Scales the mark in X and Y dimensions.
      Specified by:
      scale in class Mark
      Parameters:
      scaleFactor - how much to scale by
      Throws:
      CheckedUnsupportedOperationException - if scaling is not supported for this mark type
    • 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
    • centerPoint

      public Point3d centerPoint()
      Description copied from class: Mark
      Returns the center point of the mark.
      Specified by:
      centerPoint in class Mark
      Returns:
      the center point as a Point3d
    • 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
    • updateAfterPointsChange

      public void updateAfterPointsChange()
      Description copied from class: PointListBase
      Updates the min and max points after the list of points has changed.
      Overrides:
      updateAfterPointsChange in class PointListBase
    • 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
    • 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