|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectDimensionFilter
public class DimensionFilter
An utility class for the separation of concatenation of
pass through transforms. Given an arbitrary
math transform, this utility class will returns a new math transform
that operates only of a given set of source dimensions. For example if the supplied
transform has (x, y, z) inputs and
(longitude, latitude, height) outputs, then
the following code:
will returns a transform with (x, y) inputs and (probably) (longitude, latitude) outputs. The later can be verified with a call toaddSourceDimensionRange(0, 2); MathTransform mt = separate(transform);
getTargetDimensions().
| referencing/geotk-referencing (download) | View source code for this class |
org.geotoolkit.util.SortedIntegerSet implementation.| Field Summary | |
|---|---|
static Hints.Key |
INSTANCE
Hint key for specifying a particular instance of DimensionFilter to use. |
| Constructor Summary | |
|---|---|
DimensionFilter()
Constructs a dimension filter with the default math transform factory. |
|
DimensionFilter(Hints hints)
Constructs a dimension filter with a math transform factory built using the provided hints. |
|
DimensionFilter(MathTransformFactory factory)
Constructs a dimension filter with the specified factory. |
|
| Method Summary | |
|---|---|
void |
addSourceDimension(int dimension)
Adds an input dimension to keep. |
void |
addSourceDimensionRange(int lower,
int upper)
Adds a range of input dimensions to keep. |
void |
addSourceDimensions(int[] dimensions)
Adds input dimensions to keep. |
void |
addTargetDimension(int dimension)
Adds an output dimension to keep. |
void |
addTargetDimensionRange(int lower,
int upper)
Adds a range of output dimensions to keep. |
void |
addTargetDimensions(int[] dimensions)
Adds output dimensions to keep. |
void |
clear()
Clears any source and target dimension setting. |
static DimensionFilter |
getInstance(Hints hints)
Creates or returns an existing instance from the given set of hints. |
int[] |
getSourceDimensions()
Returns the input dimensions. |
int[] |
getTargetDimensions()
Returns the output dimensions. |
MathTransform |
separate(MathTransform transform)
Separates the specified math transform. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Hints.Key INSTANCE
DimensionFilter to use.
getInstance(org.geotoolkit.factory.Hints)| Constructor Detail |
|---|
public DimensionFilter()
public DimensionFilter(Hints hints)
hints - Hints to control the creation of the MathTransformFactory.public DimensionFilter(MathTransformFactory factory)
factory - The factory for the creation of new math transforms.| Method Detail |
|---|
public static DimensionFilter getInstance(Hints hints)
INSTANCE key, this value is returned. Otherwise a new instance is
created with the given hints.
hints - The hints, or null if none.
DimensionFilter instance (never null).INSTANCEpublic void clear()
public void addSourceDimension(int dimension)
throws IllegalArgumentException
dimension applies to the source dimensions
of the transform to be given to separate(transform).
The number must be in the range 0 inclusive to
transform.getSourceDimensions()
exclusive.
dimension - The dimension to add.
IllegalArgumentException - if dimension is negative.
public void addSourceDimensions(int[] dimensions)
throws IllegalArgumentException
dimensions apply to the source dimensions
of the transform to be given to separate(transform).
All numbers must be in the range 0 inclusive to
transform.getSourceDimensions()
exclusive. The dimensions values must be in strictly increasing order.
dimensions - The new sequence of dimensions.
IllegalArgumentException - if dimensions contains negative values or
is not a strictly increasing sequence.
public void addSourceDimensionRange(int lower,
int upper)
throws IllegalArgumentException
lower and upper values
apply to the source dimensions of the transform to be given to
separate(transform).
lower - The lower dimension, inclusive. Must not be smaller than 0.upper - The upper dimension, exclusive. Must not be greater than
transform.getSourceDimensions().
IllegalArgumentException - if lower or upper are out of bounds.
public int[] getSourceDimensions()
throws IllegalStateException
IllegalStateException - if input dimensions have not been set.
public void addTargetDimension(int dimension)
throws IllegalArgumentException
dimension applies to the target dimensions
of the transform to be given to separate(transform).
The number must be in the range 0 inclusive to
transform.getTargetDimensions()
exclusive.
dimension - The dimension to add.
IllegalArgumentException - if dimension is negative.
public void addTargetDimensions(int[] dimensions)
throws IllegalArgumentException
dimensions apply to the target dimensions
of the transform to be given to separate(transform).
All numbers must be in the range 0 inclusive to
transform.getTargetDimensions()
exclusive. The dimensions values must be in strictly increasing order.
dimensions - The new sequence of dimensions.
IllegalArgumentException - if dimensions contains negative values or
is not a strictly increasing sequence.
public void addTargetDimensionRange(int lower,
int upper)
throws IllegalArgumentException
lower and upper values
apply to the target dimensions of the transform to be given to
separate(transform).
lower - The lower dimension, inclusive. Must not be smaller than 0.upper - The upper dimension, exclusive. Must not be greater than
transform.getTargetDimensions().
IllegalArgumentException - if lower or upper are out of bounds.
public int[] getTargetDimensions()
throws IllegalStateException
separate(transform)
has been invoked at least once, in which case the target dimensions are inferred
automatically from the source dimensions and the
transform.
IllegalStateException - if this information is not available.
public MathTransform separate(MathTransform transform)
throws FactoryException
If source dimensions are unspecified, then the returned transform will expects all source dimensions as input but will produces only the specified target dimensions as output.
If target dimensions are unspecified, then the returned transform will expects only the specified source dimensions as input, and the target dimensions will be inferred automatically.
transform - The transform to separate.
FactoryException - if the transform can't be separated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||