public class CubeSurfaceFactory extends java.lang.Object implements SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
This can be used in one of two modes (determined at construction time),
isotropic and non-isotropic.
In isotropic mode, the scaling on each of the 3 axes is the same,
and in non-isotropic mode they can vary independently of each other.
The profile and aspect configuration keys (that is, the user interface)
are different according to which mode is in effect, but the actual
surfaces generated are the same either way, undistinguished instances
of CubeSurface
.
Modifier and Type | Class and Description |
---|---|
static class |
CubeSurfaceFactory.Profile
Profile class which defines fixed configuration items for
an isotropic or non-isotropic CubeSurface.
|
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.lang.Boolean> |
FRAME_KEY
Config key for whether to draw axis wire frame.
|
static ConfigKey<java.lang.Double> |
ISOCROWD_KEY
Config key for isotropic tick mark crowding.
|
static ConfigKey<java.lang.Double> |
PHI_KEY
Config key for rotation about vertical, units of degrees.
|
static ConfigKey<double[]> |
ROTMAT_KEY
Config key for rotation matrix.
|
static ConfigKey<java.lang.Double> |
SCALE_KEY
Config key for cube edge length (isotropic only).
|
static ConfigKey<java.lang.Double> |
THETA_KEY
Config key for rotation from vertical, units of degrees.
|
static ConfigKey<java.lang.Double> |
XC_KEY
Config key for X axis central position key (isotropic only).
|
static ConfigKey<java.lang.Double> |
XCROWD_KEY
Config key for X axis tick mark crowding.
|
static ConfigKey<java.lang.Boolean> |
XFLIP_KEY
Config key for X axis flip flag.
|
static ConfigKey<java.lang.String> |
XLABEL_KEY
Config key for X axis text label.
|
static ConfigKey<java.lang.Boolean> |
XLOG_KEY
Config key for X axis log scale flag.
|
static ConfigKey<java.lang.Double> |
XMAX_KEY
Config key for X axis upper bound, before subranging.
|
static ConfigKey<java.lang.Double> |
XMIN_KEY
Config key for X axis lower bound, before subranging.
|
static ConfigKey<java.lang.Double> |
XOFF_KEY
Config key for graphics X offset, units of 1/2 screen size.
|
static ConfigKey<Subrange> |
XSUBRANGE_KEY
Config key for X axis subrange.
|
static ConfigKey<java.lang.Double> |
YC_KEY
Config key for Y axis central position key (isotropic only).
|
static ConfigKey<java.lang.Double> |
YCROWD_KEY
Config key for Y axis tick mark crowding.
|
static ConfigKey<java.lang.Boolean> |
YFLIP_KEY
Config key for Y axis flip flag.
|
static ConfigKey<java.lang.String> |
YLABEL_KEY
Config key for Y axis text label.
|
static ConfigKey<java.lang.Boolean> |
YLOG_KEY
Config key for Y axis log scale flag.
|
static ConfigKey<java.lang.Double> |
YMAX_KEY
Config key for Y axis upper bound, before subranging.
|
static ConfigKey<java.lang.Double> |
YMIN_KEY
Config key for Y axis lower bound, before subranging.
|
static ConfigKey<java.lang.Double> |
YOFF_KEY
Config key for graphics Y offset, units of 1/2 screen size.
|
static ConfigKey<Subrange> |
YSUBRANGE_KEY
Config key for Y axis subrange.
|
static ConfigKey<java.lang.Double> |
ZC_KEY
Config key for Z axis central position key (isotropic only).
|
static ConfigKey<java.lang.Double> |
ZCROWD_KEY
Config key for Z axis tick mark crowding.
|
static ConfigKey<java.lang.Boolean> |
ZFLIP_KEY
Config key for Z axis flip flag.
|
static ConfigKey<java.lang.String> |
ZLABEL_KEY
Config key for Z axis text label.
|
static ConfigKey<java.lang.Boolean> |
ZLOG_KEY
Config key for Z axis log scale flag.
|
static ConfigKey<java.lang.Double> |
ZMAX_KEY
Config key for Z axis upper bound, before subranging.
|
static ConfigKey<java.lang.Double> |
ZMIN_KEY
Config key for Z axis lower bound, before subranging.
|
static ConfigKey<java.lang.Double> |
ZOOM_KEY
Config key for zoom factor.
|
static ConfigKey<Subrange> |
ZSUBRANGE_KEY
Config key for Z axis subrange.
|
Constructor and Description |
---|
CubeSurfaceFactory(boolean isIso)
Constructs an isotropic or non-isotropic cube surface factory.
|
Modifier and Type | Method and Description |
---|---|
CubeAspect |
createAspect(CubeSurfaceFactory.Profile profile,
ConfigMap config,
Range[] ranges)
Creates an aspect from configuration information.
|
Navigator<CubeAspect> |
createNavigator(ConfigMap navConfig)
Creates a navigator from configuration information.
|
CubeSurfaceFactory.Profile |
createProfile(ConfigMap config)
Creates a profile that can be used when creating a plot surface.
|
Surface |
createSurface(java.awt.Rectangle plotBounds,
CubeSurfaceFactory.Profile profile,
CubeAspect 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 double[] |
getRotation(ConfigMap rangeConfig)
Reads the intended rotation matrix from a range configuration map.
|
Range[] |
readRanges(CubeSurfaceFactory.Profile profile,
PlotLayer[] layers,
DataStore dataStore)
Provides the ranges that may be passed to
createAspect . |
boolean |
useRanges(CubeSurfaceFactory.Profile profile,
ConfigMap config)
Indicates whether ranges should be provided to generate an aspect.
|
public static final ConfigKey<java.lang.Boolean> XLOG_KEY
public static final ConfigKey<java.lang.Boolean> YLOG_KEY
public static final ConfigKey<java.lang.Boolean> ZLOG_KEY
public static final ConfigKey<java.lang.Boolean> XFLIP_KEY
public static final ConfigKey<java.lang.Boolean> YFLIP_KEY
public static final ConfigKey<java.lang.Boolean> ZFLIP_KEY
public static final ConfigKey<java.lang.String> XLABEL_KEY
public static final ConfigKey<java.lang.String> YLABEL_KEY
public static final ConfigKey<java.lang.String> ZLABEL_KEY
public static final ConfigKey<java.lang.Boolean> FRAME_KEY
public static final ConfigKey<java.lang.Double> XCROWD_KEY
public static final ConfigKey<java.lang.Double> YCROWD_KEY
public static final ConfigKey<java.lang.Double> ZCROWD_KEY
public static final ConfigKey<java.lang.Double> ISOCROWD_KEY
public static final ConfigKey<java.lang.Double> XMIN_KEY
public static final ConfigKey<java.lang.Double> XMAX_KEY
public static final ConfigKey<java.lang.Double> YMIN_KEY
public static final ConfigKey<java.lang.Double> YMAX_KEY
public static final ConfigKey<java.lang.Double> ZMIN_KEY
public static final ConfigKey<java.lang.Double> ZMAX_KEY
public static final ConfigKey<java.lang.Double> XC_KEY
public static final ConfigKey<java.lang.Double> YC_KEY
public static final ConfigKey<java.lang.Double> ZC_KEY
public static final ConfigKey<java.lang.Double> SCALE_KEY
public static final ConfigKey<java.lang.Double> THETA_KEY
public static final ConfigKey<java.lang.Double> PHI_KEY
public static final ConfigKey<java.lang.Double> ZOOM_KEY
public static final ConfigKey<java.lang.Double> XOFF_KEY
public static final ConfigKey<java.lang.Double> YOFF_KEY
public static final ConfigKey<double[]> ROTMAT_KEY
public CubeSurfaceFactory(boolean isIso)
isIso
- whether to operate in isotropic modepublic Surface createSurface(java.awt.Rectangle plotBounds, CubeSurfaceFactory.Profile profile, CubeAspect aspect)
SurfaceFactory
createSurface
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
plotBounds
- rectangle to containing actual plot data
(not insets)profile
- configuration object defining plot styleaspect
- configuration object defining plot viewpointpublic ConfigKey[] getProfileKeys()
SurfaceFactory
createProfile
method.getProfileKeys
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
public CubeSurfaceFactory.Profile createProfile(ConfigMap config)
SurfaceFactory
getProfileKeys
.
The return value can be used as input to
createSurface
and other methods in this class.createProfile
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
config
- map of profile configuration itemspublic ConfigKey[] getAspectKeys()
SurfaceFactory
useRanges
and
createAspect
methods.getAspectKeys
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
public boolean useRanges(CubeSurfaceFactory.Profile profile, ConfigMap config)
SurfaceFactory
readRanges
to createAspect
alongside the arguments of this method.
If false, any such ranges will be ignored.useRanges
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
profile
- surface configuration profileconfig
- configuration map that may contain keys from
getAspectKeys
public CubeAspect createAspect(CubeSurfaceFactory.Profile profile, ConfigMap config, Range[] ranges)
SurfaceFactory
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
.createAspect
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
profile
- surface configuration profileconfig
- configuration map that may contain keys from
getAspectKeys
ranges
- range data filled in from layers, or nullpublic Range[] readRanges(CubeSurfaceFactory.Profile profile, PlotLayer[] layers, DataStore dataStore)
SurfaceFactory
createAspect
.
There is only any point calling this if useRanges
returns true.readRanges
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
profile
- surface configuration profilelayers
- plot layers to be plotteddataStore
- contains actual datapublic ConfigKey[] getNavigatorKeys()
SurfaceFactory
SurfaceFactory.createNavigator(uk.ac.starlink.ttools.plot2.config.ConfigMap)
method.getNavigatorKeys
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
public Navigator<CubeAspect> createNavigator(ConfigMap navConfig)
SurfaceFactory
createNavigator
in interface SurfaceFactory<CubeSurfaceFactory.Profile,CubeAspect>
navConfig
- configuration map that may contain keys from
getNavigatorKeys
public static double[] getRotation(ConfigMap rangeConfig)
rangeConfig
- config map from which range values may be readCopyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.