public class SkyPath extends Object
Morphing object to convert a ra-dec path on
the sky to a pixel path. GeneralPath is decalred final, thus
we cannot extend it.| Modifier and Type | Field and Description |
|---|---|
private GeneralPath |
path
The general path used to construct pixel coordinates.
|
private CoordinateTransforming |
radec
The morpher converting radec into pixels.
|
| Constructor and Description |
|---|
SkyPath(CoordinateTransforming sphere)
Constructs a new general sky path that defines a
Morphing
instance to convert spherical coordinates into pixel coordinates. |
| Modifier and Type | Method and Description |
|---|---|
void |
closePath()
Closes the path.
|
Shape |
getPath()
Returns the general path on the sky in pixel coordinates as a shape.
|
void |
lineTo(VectorG star)
Similar to the general path line to, we move out path iterator to a
new point on the sphere.
|
void |
moveTo(VectorG star)
Similar to the general path move to, we move out path iterator to a
new point on the sphere.
|
static Shape |
parse(String wind,
CoordinateTransforming sky)
Converts a string into a sky path.
|
private static int |
parseNext(GeneralPath path,
CoordinateTransforming radec,
String wind,
int index)
Parses a single operation starting from index in the specified string.
|
private static int |
parsePosition(String wind,
int index,
Vector2D sky)
Parse a position starting at the specified index.
|
void |
reset()
Reset the path in the sky.
|
private CoordinateTransforming radec
private GeneralPath path
public SkyPath(CoordinateTransforming sphere)
Morphing
instance to convert spherical coordinates into pixel coordinates.public void moveTo(VectorG star)
star - A sky position, x is ra in degrees, y declination.public void lineTo(VectorG star)
star - A sky position, x is ra in degrees, y declination.public Shape getPath()
public void reset()
public void closePath()
public static Shape parse(String wind, CoordinateTransforming sky) throws ParseException
m123.456,-67.45l176.23,-77.45cm111.23,-45.67l133.45-54.67
The returned shape is a newly allocated general path. It can later
be queried with getPath().
Note that legal string must always start with a move.IllegalPathStateException - If string does not start with move.ParseException - In case of parsing errors.private static int parseNext(GeneralPath path, CoordinateTransforming radec, String wind, int index) throws ParseException
ParseExceptionprivate static int parsePosition(String wind, int index, Vector2D sky) throws ParseException
Point2D object into which the parses position
is squeezed into.ParseException