Package uk.ac.starlink.ttools.plot2.data
Class Area
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.data.Area
-
public class Area extends java.lang.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 class
Area.Type
Available shape types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getDataArray()
Returns the numeric array that in conjunction with the type code defines the coverage of this shape.Area.Type
getType()
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).
-
-
-
Constructor Detail
-
Area
public Area(Area.Type type, double[] dataArray)
Constructor.- Parameters:
type
- area shape typedataArray
- numeric array defining the actual shape of the area
-
-
Method Detail
-
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
-
-