Package org.jzy3d.maths
Class GridLoader
java.lang.Object
org.jzy3d.maths.GridLoader
- All Implemented Interfaces:
IColorMappable
Deprecated.
The GridLoader utility offers a way to convert coordinates mode. When input data is made of lists
of x, y, and z points, and that these lists actually contain data that regularly lie on a squared
grid (orthonormal grid), the GridLoader allows a smart retrieving of data by providing:
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:
If some points are missing in the input list to generate a complete grid, the output grid will contain Z=NaN values for missing coordinates.
- an 1D array of sorted X coordinates (without doublon).
- an 1D array of sorted Y coordinates (without doublon).
- an 2D array of Z coordinates syncronized with arrays X and Y.
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
If some points are missing in the input list to generate a complete grid, the output grid will contain Z=NaN values for missing coordinates.
- Author:
- Martin Pernollet
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGridLoader
(float[] x, float[] y, float[] z) Deprecated.Initialize a GridLoader by parsing the square grid directly. -
Method Summary
Modifier and TypeMethodDescriptionvoid
extrapolate
(int n) Deprecated.Add extrapolated points on the grid.Deprecated.Return a BoundingBox indicating the bounds of the loaded data.getExtrapolatedRingPolygons
(float ringMax, IColorMap cmap, Color colorFactor) Deprecated.getInterpolatedRingPolygons
(float ringMin, float ringMax, IColorMap cmap, Color colorFactor) Deprecated.Load data standing on an orthonormal grid.double
getMax()
Deprecated.Retrieve the upper value boundary for aIColorMap
.double
getMin()
Deprecated.Retrieve the lower value boundary for aIColorMap
.getSquarePolygons
(IColorMap cmap, Color colorFactor) Deprecated.protected void
setData
(float[] x, float[] y, float[] z) Deprecated.Set the array of data.void
setMax
(double zmax) Deprecated.Set the upper value boundary for aIColorMap
.void
setMin
(double zmin) Deprecated.Set the lower value boundary for aIColorMap
.
-
Field Details
-
x
public float[] xDeprecated. -
y
public float[] yDeprecated. -
z
public float[][] zDeprecated.
-
-
Constructor Details
-
GridLoader
public GridLoader(float[] x, float[] y, float[] z) Deprecated.Initialize a GridLoader by parsing the square grid directly. When the grid is parsed, the GridLoader may return either:- a set of polygon describing a ring with smooth contour
-
-
Method Details
-
getBoundingBox
Deprecated.Return a BoundingBox indicating the bounds of the loaded data.- Returns:
- a bounding box.
-
setData
protected void setData(float[] x, float[] y, float[] z) Deprecated.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
While parsing input data, the minimal and maximal Z values are computed, in order to have the loader ready for computing polygons color with a colormap.- Parameters:
x
- list of x coordinatesy
- list of y coordinatesz
- list of z coordinates- Throws:
an
- IllegalArgumentException if x, y , and z have not the same size
-
getSquarePolygons
Deprecated. -
getExtrapolatedRingPolygons
Deprecated. -
extrapolate
public void extrapolate(int n) Deprecated.Add extrapolated points on the grid. If the grid is too small for extrapolation, the arrays are maximized -
getInterpolatedRingPolygons
public List<Polygon> getInterpolatedRingPolygons(float ringMin, float ringMax, IColorMap cmap, Color colorFactor) Deprecated.Load data standing on an orthonormal grid.
Each input point (i.e. the association of x[i], y[j], z[i][j]) will be represented by a polygon centered on this point. The default coordinates of this polygon will be:- x[i-1], y[j+1], z[i-1][j+1]
- x[i-1], y[j-1], z[i-1][j-1]
- x[i+1], y[j-1], z[i+1][j-1]
- x[i+1], y[j+1], z[i+1][j+1]
- those that stand completely inside the ringMin and ringMax radius and that have the previous coordinates.
- those that stand completely outside the ringMin and ringMax radius and that won't be added to the list of polygons.
- those that have some points in and some points out of the ringMin and ringMax radius. These
polygons are recomputed so that "out" points are replaced by two points that make the smooth
contour. According to the number of "out" points, the modified polygon will gather 3, 4, or 5
points.
As a consequence, it is suggested to provide data ranging outside of ringMin and ringMax, in order to be sure to have a perfect round surface.
- Parameters:
ringMin
- the minimum radius of this ring.ringMax
- the maximum radius of this ring.colorFactor
- a weighting factor for the color returned by the Colormap.
-
getMin
public double getMin()Deprecated.Description copied from interface:IColorMappable
Retrieve the lower value boundary for aIColorMap
.- Specified by:
getMin
in interfaceIColorMappable
- Returns:
- the minimum Z value
-
getMax
public double getMax()Deprecated.Description copied from interface:IColorMappable
Retrieve the upper value boundary for aIColorMap
.- Specified by:
getMax
in interfaceIColorMappable
- Returns:
- the maximum Z value
-
setMin
public void setMin(double zmin) Deprecated.Description copied from interface:IColorMappable
Set the lower value boundary for aIColorMap
.- Specified by:
setMin
in interfaceIColorMappable
- Parameters:
zmin
- the minimum Z value
-
setMax
public void setMax(double zmax) Deprecated.Description copied from interface:IColorMappable
Set the upper value boundary for aIColorMap
.- Specified by:
setMax
in interfaceIColorMappable
- Parameters:
zmax
- the maximum Z value
-