Class Area

java.lang.Object
uk.ac.starlink.ttools.plot2.data.Area

public class Area extends Object
Coordinate value representing a two-dimensional shaped area. Instances of this class can be serialized to a plot tuple element. The shape is defined by a numeric code (Type enum) and a numeric array, so that it can be easily de/serialised.

Currently no distinction is made in this object between shapes on a 2-d plane and on the surface of a sphere; instances of this class may be interpreted in either context as required.

Since:
27 Mar 2020
Author:
Mark Taylor
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Available shape types.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Area(Area.Type type, double[] dataArray)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Returns the numeric array that in conjunction with the type code defines the coverage of this shape.
    Returns the type of this shape.
    void
    writePlaneCoords2(double[] buffer)
    Writes the characteristic (typically central) position of this area to a buffer that can be interpreted as the positional coordinates in the data space of a plane plot (x, y values).
    void
    writeSkyCoords3(double[] buffer)
    Writes the characteristic (typically central) position of this area to a buffer that can be interpreted as the positional coordinates in the data space of a sky plot (3-element unit vector).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Area

      public Area(Area.Type type, double[] dataArray)
      Constructor.
      Parameters:
      type - area shape type
      dataArray - numeric array defining the actual shape of the area
  • Method Details

    • getType

      public Area.Type getType()
      Returns the type of this shape.
      Returns:
      shape type
    • getDataArray

      public double[] getDataArray()
      Returns the numeric array that in conjunction with the type code defines the coverage of this shape.
      Returns:
      shape definition array
    • writePlaneCoords2

      public void writePlaneCoords2(double[] buffer)
      Writes the characteristic (typically central) position of this area to a buffer that can be interpreted as the positional coordinates in the data space of a plane plot (x, y values).
      Parameters:
      buffer - output array for characteristic position, length >=2
    • writeSkyCoords3

      public void writeSkyCoords3(double[] buffer)
      Writes the characteristic (typically central) position of this area to a buffer that can be interpreted as the positional coordinates in the data space of a sky plot (3-element unit vector).
      Parameters:
      buffer - output array for characteristic position, length >=3