|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.ChartDataset
com.quinncurtis.chart2djava.SimpleDataset
com.quinncurtis.chart2djava.ContourDataset
public class ContourDataset
The ContourDataset class extends the SimpleDataset class, adding a third dimension (z-values) needed to produce a contour plot.
Field Summary |
---|
Fields inherited from class com.quinncurtis.chart2djava.ChartDataset |
---|
initialCondition, markLookaheadLimit |
Constructor Summary | |
---|---|
ContourDataset()
The default ContourDataset constructor. |
|
ContourDataset(CSV csv,
java.lang.String filename,
int rowskip,
int columnskip)
This constructor creates a new ContourDataset object from a file consisting of comma separated values. |
|
ContourDataset(java.lang.String sname,
ChartPoint3D[] grid)
This constructor creates a new ContourDataset object that will be placed in the specified coordinate system. |
|
ContourDataset(java.lang.String sname,
ChartPoint3D[] grid,
int rows,
int columns)
This constructor creates a new ContourDataset object that will be placed in the specified coordinate system. |
|
ContourDataset(java.lang.String sname,
double[] x,
double[] y,
double[] z)
This constructor creates a new ContourDataset object that will be placed in the specified coordinate system. |
|
ContourDataset(java.lang.String sname,
int rows,
int columns,
double x1,
double y1,
double x2,
double y2,
SurfaceFunction sf)
This constructor creates a new ContourDataset object that will be placed in the specified coordinate system. |
Method Summary | |
---|---|
boolean |
calcNearestPoint(PhysicalCoordinates transform,
ChartPoint2D testpoint,
int nmode,
NearestPointData nearestpoint)
This method compares a test point against all of the xy points in a contour dataset and calculates which point in the dataset is nearest the test point. |
java.lang.Object |
clone()
Returns an object that is a clone of this ContourDataset object. |
ContourDataset |
compressContourDataset(int ctypex,
int ctypey,
int ctypez,
int interval,
int startindex,
int endindex,
java.lang.String newname)
This methods creates and returns a new dataset that is the data reduced version of the source dataset. |
void |
copy(ContourDataset source)
Copies the source dataset. |
int |
errorCheck(int nerror)
Checks the current dataset object for common errors. |
ChartPoint3D |
getDataPoint3D(int index)
This method returns the x-, y- and z-values of a point at the specified index. |
double |
getDatasetMax(int naxis)
This method returns the maximum value for either the xData, yData or zData arrays. |
double |
getDatasetMin(int naxis)
This method returns the minimum value for either the xData, yData or zData arrays. |
int |
getFirstValidIndex()
This method returns the index of the first valid data point in a simple dataset. |
int |
getNumberGroups()
This method returns the value of the numberGroups field which is number of groups in a group dataset. |
Polysurface |
getPolysurface()
Returns the private Polysurface structure used to organize the dataset data points as a polysurface suitable for contour plot analysis. |
double[] |
getZData()
This method returns a reference to the zData array. |
DoubleArray |
getZDataObj()
This method returns a reference to the internal DoubleArray used to store the z-values. |
double |
getZDataValue(int index)
This method returns the z-value in a contour dataset. |
boolean |
isDataPointGood(int index)
This method checks if the point at the specified index for a simple dataset is valid. |
void |
readContourDataset(CSV csv,
java.lang.String filename,
int rowskip,
int columnskip)
This method reads a contour dataset from a file consisting of comma separated values. |
void |
readContourDatasetAsResource(CSV csv,
java.io.BufferedReader pReader,
int rowskip,
int columnskip)
This method reads a contour dataset from a file consisting of comma separated values. |
int |
resize(int n)
Resizes the dataset, maintaining the original data. |
void |
setDataPoint(int index,
ChartPoint3D p)
Sets the x-, y- and z-values for a data point in a contour dataset. |
void |
setDataPoint(int index,
double x,
double y,
double z)
Sets the x- and y- and z-values for a data point in a contour dataset. |
void |
setZDataValue(double z,
int index)
Sets the z-value in a contour dataset. |
void |
writeContourDataset(CSV csv,
java.lang.String filename)
This method writes a contour dataset to a file as comma separated values. |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContourDataset()
public ContourDataset(CSV csv, java.lang.String filename, int rowskip, int columnskip)
csv
- An instance of an CSV object.filename
- The name of the file.rowskip
- Skip this many rows before starting the read operation.columnskip
- For each row of data, skip this many columns before reading the first
value from the row.public ContourDataset(java.lang.String sname, ChartPoint3D[] grid)
sname
- Specifies the name of the dataset.grid
- An array of ChartPoint3D points, that specifies the xyz values of a dataset.
The data points do not have to form an regular grid in the xy plane. A triangularization function is
run on the data points to define a surface.public ContourDataset(java.lang.String sname, ChartPoint3D[] grid, int rows, int columns)
sname
- Specifies the name of the dataset.grid
- An array, size [rows columns] of ChartPoint3D points, that specifies the xyz
values of a dataset. The data points must form an regular grid in the xy plane. A regular grid is
one where the x-increment between adjacent x values is fixed, as is the y-increment. The x-increment
and the y-increment do not have to be the same.rows
- Specifies the number of rows (in the y direction) in the regular grid.columns
- Specifies the number of columns (in the x direction) in the regular grid.public ContourDataset(java.lang.String sname, double[] x, double[] y, double[] z)
sname
- Specifies the name of the dataset.x
- An array that specifies the x-values of the dataset.y
- An array that specifies the y-values of the dataset.z
- An array that specifies the z-values of the dataset. The data points do not have to
form an regular grid in the xy plane. A triangularization function is run on the data points to define a surface.public ContourDataset(java.lang.String sname, int rows, int columns, double x1, double y1, double x2, double y2, SurfaceFunction sf)
sname
- Specifies the name of the dataset.rows
- Specifies the number of rows (or y-values) to evaluate the function over.columns
- Specifies the number of columns (or x-values) to evaluate the function over.x1
- y1
- x2
- y2
- The Surface function sf is evaluated for the range x1,y1 to x2, y2.sf
- The dataset data points are created by evaluating the SurfaceFunction across
the range x1,y1 to x2, y2.
Method Detail |
---|
public boolean calcNearestPoint(PhysicalCoordinates transform, ChartPoint2D testpoint, int nmode, NearestPointData nearestpoint)
calcNearestPoint
in class SimpleDataset
transform
- The coordinate system of the test point.testpoint
- The test point for the nearness calculation.nmode
- Specifies the algorithm used in the nearness calculation.nearestpoint
- Returns the parameters of the nearest point.
public java.lang.Object clone()
clone
in class SimpleDataset
public ContourDataset compressContourDataset(int ctypex, int ctypey, int ctypez, int interval, int startindex, int endindex, java.lang.String newname)
ctypex
- The compression type. Use one of the data compression type constants:
DATACOMPRESS_NONE (returns a dataset containing the points in the specified range, no compression),
DATACOMPRESS_SKIP (sample the dataset every interval points), DATACOMPRESS_AVERAGE
(use the average x- and y-value in each interval), DATACOMPRESS_MIN (use the minimum x- and y-value in each interval),
DATACOMPRESS_MAX (use the maximum x- and y-value in each interval),
and DATACOMPRESS_MINMAX (use the minimum and maximum x- and y-value in each interval).ctypey
- The compression type for the y-values. Use one of the he data compression type constants.ctypez
- The compression type for the z-values. Use one of the he data compression type constants.interval
- The number of data points in each segment that is reduced to a single datapoint
(two for the DATACOMPRESS_MINMAX compression type) in the compressed dataset.startindex
- The starting point, inclusive, in the source dataset for the data compression.endindex
- The ending index, inclusive, in the source dataset for the data compression.newname
- The string name for the new dataset.
public void copy(ContourDataset source)
source
- The source dataset object.public int errorCheck(int nerror)
errorCheck
in class SimpleDataset
nerror
- Current error state.
public ChartPoint3D getDataPoint3D(int index)
index
- Specifies the index of the data point.
public double getDatasetMax(int naxis)
getDatasetMax
in class SimpleDataset
naxis
- Specifies which data array to return the maximum value from. Use X_AXIS Y_AXIS or
Z_AXIS to specify which dataset array.
public double getDatasetMin(int naxis)
getDatasetMin
in class SimpleDataset
naxis
- Specifies which data array to return the minimum value from. Use X_AXIS Y_AXIS or
Z_AXIS to specify which dataset array.
public int getFirstValidIndex()
getFirstValidIndex
in class SimpleDataset
public int getNumberGroups()
getNumberGroups
in class SimpleDataset
public Polysurface getPolysurface()
public double[] getZData()
public DoubleArray getZDataObj()
public double getZDataValue(int index)
index
- Specifies the index of the z-value values.
public boolean isDataPointGood(int index)
isDataPointGood
in class SimpleDataset
index
- Specifies the index to check in the xData and yData arrays.
public void readContourDataset(CSV csv, java.lang.String filename, int rowskip, int columnskip)
csv
- An instance of an CSV object.filename
- The name of the file.rowskip
- Skip this many rows before starting the read operation.columnskip
- For each row of data, skip this many columns before reading the first value from the row.public void readContourDatasetAsResource(CSV csv, java.io.BufferedReader pReader, int rowskip, int columnskip)
csv
- An instance of an CSV object.pReader
- A BufferedReader data stream. Must support BufferedReader mark and reset methods.rowskip
- Skip this many rows before starting the read operation.columnskip
- For each row of data, skip this many columns before reading the first value from the row.public int resize(int n)
resize
in class SimpleDataset
n
- The new size of the dataset.public void setDataPoint(int index, ChartPoint3D p)
index
- Specifies the index for the new data values.p
- Specifies the new x-, y- and z-values for the data point at the specified index.public void setDataPoint(int index, double x, double y, double z)
index
- Specifies the index for the new data values.x
- Specifies the new x-value for the data point at the specified index.y
- Specifies the new y-value for the data point at the specified index.z
- Specifies the new z-value for the data point at the specified index.public void setZDataValue(double z, int index)
z
- Specifies the new z-value for the data point at the specified index.index
- Specifies the index for the data value.public void writeContourDataset(CSV csv, java.lang.String filename)
csv
- An instance of an CSV object.filename
- The name of the file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |