Interface, used by {@link Pattern} implementations to indicate thatthey are uniform-grid patterns, i.e. subsets of the set of all mesh nodes of some uniform grids. See also the section "Uniform-grid patterns" in the comments to {@link Pattern} interface.
More precisely, a pattern, implementing this interface, is some set of N points (N>0)
x0(k) = o0 + i0(k)d0
x1(k) = o1 + i1(k)d1
. . .
xn−1(k) = on−1 + in−1(k)dn−1
where oj and dj are some constants (dj>0) and ij(k) are any integer numbers. The point o=(o0,o1,...,on−1), named origin of the grid, and the vector d=(d0,d1,...,dn−1), named steps of the grid, are specified while creating the pattern. Moreover, these parameters about (o and d) are stored inside the object and can be quickly read at any time by {@link #originOfGrid()} and {@link #stepsOfGrid()} methods— this condition is a requirement for all implementations of this interface.
The numbers ij(k) are called grid indexes of the points of the pattern (or, briefly, grid indexes of the pattern). The integer points
Warning: not only patterns, implementing this interface, are actually such sets of points. Moreover, many patterns, created by this package, are really uniform grid (all their points really belong to set of mesh points of some uniform grid), but they do not implement this interface and are not considered to be "uniform-grid". The typical examples are Minkowski sums, created by {@link Patterns#newMinkowskiSum(Collection)} method,and unions, created by {@link Patterns#newUnion(Collection)} method.It is obvious that a Minkowski sum or a union of several uniform-grid patterns, having zero origin o=(0,0,...,0) and the same steps d, are also uniform-grid patterns with the same origin and steps. However, it is very probably that the objects, returned by {@link Patterns#newMinkowskiSum(Collection)} and {@link Patterns#newUnion(Collection)} methods,will not implement {@link UniformGridPattern} interface even in this "good" case.
There are the following guarantees for grid indexes ij(k) of any uniform-grid pattern:
Each implementation of this interface must fulfil both restriction. Any attempt to create a uniform-grid pattern, the grid indexes of which do not satisfy these restrictions, leads to {@link TooLargePatternCoordinatesException}.
These restrictions are guaranteed together with the coordinate restrictions, described in the section "Coordinate restrictions" in the comments to {@link Pattern} interface.These restrictions provide a guarantee that the method {@link #gridIndexPattern()} alwaysworks successfully and creates a correct integer pattern.
AlgART Laboratory 2007–2014
@author Daniel Alievsky @version 1.2 @since JDK 1.5
|
|
|
|