Class OrthonormalTessellator

  • Direct Known Subclasses:
    OldRingTesselator, RingExtrapolator, RingInterpolator, RingTessellator

    public class OrthonormalTessellator
    extends Tessellator
    The OrthonormalTessellator checks that coordinates are lying on an orthormal grid, and is able to provide a Composite made of Polygons built according to this grid On this model, one input coordinate is represented by one Polygon, for which each point is a mean point between two grid ticks:
     
     
      ^                           ^
      |                           |
      -   +   +   +               -   +   +   +
      |                           |     *---*
      -   +   o   +        >>     -   + | o | +
      |                           |     *---*
      -   +   +   +               -   +   +   +
      |                           |
      |---|---|---|-->            |---|---|---|-->
      
      
     
    In this figure, the representation of a coordinate ("o" on the left) is a polygon made of mean points ("*" on the right) that require the existence of four surrounding points (the "o" and the three "+")
    Author:
    Martin Pernollet
    • Field Detail

      • x

        protected float[] x
      • y

        protected float[] y
      • z

        protected float[][] z
      • findxi

        protected int findxi
      • findyj

        protected int findyj
    • Constructor Detail

      • OrthonormalTessellator

        public OrthonormalTessellator()
    • Method Detail

      • setData

        protected void setData​(float[] x,
                               float[] y,
                               float[] z)
        Set the array of data. X,Y, and Z are arrays that must implicitely represent an orthonormal grid. If some data are missing for representing this grid, missing data will be considered as NaN. The actual management of missing values is thus left to the object that loads these data. In the following example, the o represent a NaN Z value, meaning that there was no (x[i],y[i],z[i]) triplet for representing it correctly:
         
         11111111 y
         11111111  
         11o11111  
         11111111  
         
         x         
         
         

        Parameters:
        x - list of x coordinates
        y - list of y coordinates
        z - list of z coordinates
        Throws:
        an - IllegalArgumentException if x, y , and z have not the same size
      • unique

        protected float[] unique​(float[] data)
        Compute a sorted array from input, with a unique occurrence of each value. Note: any NaN value will be ignored and won't appear in the output array.
        Parameters:
        data - input array.
        Returns:
        a sorted array containing only one occurrence of each input value.
      • find

        protected boolean find​(float[] x,
                               float[] y,
                               float vx,
                               float vy)
        Search in a couple of array a combination of values vx and vy. Positions xi and yi are returned by reference. Function returns true if the couple of data may be retrieved, false otherwise (in this case, xi and yj remain unchanged).
      • getSquarePolygonsOnCoordinates

        public List<Drawable> getSquarePolygonsOnCoordinates()
      • getSquarePolygonsAroundCoordinates

        public List<Drawable> getSquarePolygonsAroundCoordinates()
      • getRealQuadStandingOnPoint

        protected Point[] getRealQuadStandingOnPoint​(int xi,
                                                     int yi)
      • getEstimatedQuadSurroundingPoint

        protected Point[] getEstimatedQuadSurroundingPoint​(int xi,
                                                           int yi)
      • validZ

        protected boolean validZ​(Point[] points)
      • validZ

        protected boolean validZ​(Point p)