uk.ac.starlink.ttools.plot2.geom
Class SkySurfaceFactory

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.geom.SkySurfaceFactory
All Implemented Interfaces:
SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>

public class SkySurfaceFactory
extends Object
implements SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>

Surface factory for plotting on the surface of the celestial sphere.

Since:
20 Feb 2013
Author:
Mark Taylor

Nested Class Summary
static class SkySurfaceFactory.Profile
          Profile class which defines fixed configuration items for a SkySurface.
 
Field Summary
static ConfigKey<SkyAxisLabeller> AXISLABELLER_KEY
          Config key to control axis label positioning.
static ConfigKey<Double> CROWD_KEY
          Config key to control tick mark crowding.
static ConfigKey<Double> FOV_RADIUS_KEY
          Config key for specifying aspect field of view, in degrees.
static ConfigKey<Boolean> GRID_KEY
          Config key to determine whether grid lines are drawn.
static ConfigKey<Double> LAT_KEY
          Config key for specifying aspect central latitude, in degrees.
static ConfigKey<Double> LON_KEY
          Config key for specifying aspect central longitude, in degrees.
static ConfigKey<Projection> PROJECTION_KEY
          Config key for sky projection type.
static ConfigKey<Boolean> REFLECT_KEY
          Config key to determine whether longitude runs right to left.
static ConfigKey<Boolean> SEX_KEY
          Config key to determine whether sexagesimal coordinates are used.
static ConfigKey<SkySys> VIEWSYS_KEY
          Config key for the sky system used for projecting the data.
 
Constructor Summary
SkySurfaceFactory()
           
 
Method Summary
 SkyAspect createAspect(SkySurfaceFactory.Profile profile, ConfigMap config, Range[] ranges)
          Creates an aspect from configuration information.
 Navigator<SkyAspect> createNavigator(ConfigMap navConfig)
          Creates a navigator from configuration information.
 SkySurfaceFactory.Profile createProfile(ConfigMap config)
          Creates a profile that can be used when creating a plot surface.
 Surface createSurface(Rectangle plotBounds, SkySurfaceFactory.Profile p, SkyAspect aspect)
          Returns a new plot surface.
 ConfigKey[] getAspectKeys()
          Returns the configuration keys that may be used to configure aspect for this surface factory.
 ConfigKey[] getNavigatorKeys()
          Returns the configuration keys that may be used to configure a navigator for use with this surface factory.
 ConfigKey[] getProfileKeys()
          Returns the configuration keys used to configure profile for this surface factory.
static boolean isAllSky(Range[] vxyzRanges)
          Determines whether a set of ranges of normalised data coordinates cover enough of the full data cube (-1..+1 in each dimension) to count as full sky coverage.
 Range[] readRanges(SkySurfaceFactory.Profile profile, PlotLayer[] layers, DataStore dataStore)
          Provides the ranges that may be passed to createAspect.
 boolean useRanges(SkySurfaceFactory.Profile profile, ConfigMap config)
          Indicates whether ranges should be provided to generate an aspect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROJECTION_KEY

public static final ConfigKey<Projection> PROJECTION_KEY
Config key for sky projection type.


REFLECT_KEY

public static final ConfigKey<Boolean> REFLECT_KEY
Config key to determine whether longitude runs right to left.


VIEWSYS_KEY

public static final ConfigKey<SkySys> VIEWSYS_KEY
Config key for the sky system used for projecting the data.


GRID_KEY

public static final ConfigKey<Boolean> GRID_KEY
Config key to determine whether grid lines are drawn.


CROWD_KEY

public static final ConfigKey<Double> CROWD_KEY
Config key to control tick mark crowding.


AXISLABELLER_KEY

public static final ConfigKey<SkyAxisLabeller> AXISLABELLER_KEY
Config key to control axis label positioning.


SEX_KEY

public static final ConfigKey<Boolean> SEX_KEY
Config key to determine whether sexagesimal coordinates are used.


LON_KEY

public static final ConfigKey<Double> LON_KEY
Config key for specifying aspect central longitude, in degrees.


LAT_KEY

public static final ConfigKey<Double> LAT_KEY
Config key for specifying aspect central latitude, in degrees.


FOV_RADIUS_KEY

public static final ConfigKey<Double> FOV_RADIUS_KEY
Config key for specifying aspect field of view, in degrees.

Constructor Detail

SkySurfaceFactory

public SkySurfaceFactory()
Method Detail

createSurface

public Surface createSurface(Rectangle plotBounds,
                             SkySurfaceFactory.Profile p,
                             SkyAspect aspect)
Description copied from interface: SurfaceFactory
Returns a new plot surface.

Specified by:
createSurface in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Parameters:
plotBounds - rectangle to containing actual plot data (not insets)
p - configuration object defining plot style
aspect - configuration object defining plot viewpoint
Returns:
new plot surface

getProfileKeys

public ConfigKey[] getProfileKeys()
Description copied from interface: SurfaceFactory
Returns the configuration keys used to configure profile for this surface factory. The returned keys are used in the map supplied to the createProfile method.

Specified by:
getProfileKeys in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Returns:
profile configuration keys

createProfile

public SkySurfaceFactory.Profile createProfile(ConfigMap config)
Description copied from interface: SurfaceFactory
Creates a profile that can be used when creating a plot surface. The keys that are significant in the supplied config map are those returned by getProfileKeys. The return value can be used as input to createSurface and other methods in this class.

Specified by:
createProfile in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Parameters:
config - map of profile configuration items
Returns:
factory-specific plot surface profile

getAspectKeys

public ConfigKey[] getAspectKeys()
Description copied from interface: SurfaceFactory
Returns the configuration keys that may be used to configure aspect for this surface factory. The returned keys are used in the map supplied to the useRanges and createAspect methods.

Specified by:
getAspectKeys in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Returns:
aspect configuration keys

useRanges

public boolean useRanges(SkySurfaceFactory.Profile profile,
                         ConfigMap config)
Description copied from interface: SurfaceFactory
Indicates whether ranges should be provided to generate an aspect. If true, it is beneficial to pass the result of readRanges to createAspect alongside the arguments of this method. If false, any such ranges will be ignored.

Specified by:
useRanges in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Parameters:
profile - surface configuration profile
config - configuration map that may contain keys from getAspectKeys
Returns:
true iff calculated ranges will be of use

createAspect

public SkyAspect createAspect(SkySurfaceFactory.Profile profile,
                              ConfigMap config,
                              Range[] ranges)
Description copied from interface: SurfaceFactory
Creates an aspect from configuration information. The ranges argument will be used only if useRanges returns true. It is legal to give the ranges argument as null in any case. In all cases, the returned value must be non-null and usable by createSurface.

Specified by:
createAspect in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Parameters:
profile - surface configuration profile
config - configuration map that may contain keys from getAspectKeys
ranges - range data filled in from layers, or null
Returns:
new aspect

readRanges

public Range[] readRanges(SkySurfaceFactory.Profile profile,
                          PlotLayer[] layers,
                          DataStore dataStore)
Description copied from interface: SurfaceFactory
Provides the ranges that may be passed to createAspect. There is only any point calling this if useRanges returns true.

Specified by:
readRanges in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Parameters:
profile - surface configuration profile
layers - plot layers to be plotted
dataStore - contains actual data
Returns:
data ranges covered by the given layers filled in from data

getNavigatorKeys

public ConfigKey[] getNavigatorKeys()
Description copied from interface: SurfaceFactory
Returns the configuration keys that may be used to configure a navigator for use with this surface factory. The returned keys are used in the map supplied to the SurfaceFactory.createNavigator(uk.ac.starlink.ttools.plot2.config.ConfigMap) method.

Specified by:
getNavigatorKeys in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Returns:
navigator configuration keys

createNavigator

public Navigator<SkyAspect> createNavigator(ConfigMap navConfig)
Description copied from interface: SurfaceFactory
Creates a navigator from configuration information. The returned value will be non-null.

Specified by:
createNavigator in interface SurfaceFactory<SkySurfaceFactory.Profile,SkyAspect>
Parameters:
navConfig - configuration map that may contain keys from getNavigatorKeys
Returns:
navigator for use with surfaces produced by this factory

isAllSky

public static boolean isAllSky(Range[] vxyzRanges)
Determines whether a set of ranges of normalised data coordinates cover enough of the full data cube (-1..+1 in each dimension) to count as full sky coverage. It's a bit arbitrary what this means, but in case of full sky the view should not be centred on any particular position.

Parameters:
vxyzRanges - 3-element array giving data ranges for normalised X,Y,Z coordinates
Returns:
true if they cover most of the sky


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.