jhplot
Class P3D

java.lang.Object
  extended by jhplot.P3D

public class P3D
extends java.lang.Object

A container to hold data points in X,Y,Z and their extensions dX,dY,dZ. Use this class to draw a surface sigment.


Constructor Summary
P3D()
          Construct an empty container with a title
P3D(java.lang.String title)
          Construct an empty container with a title
P3D(java.lang.String title, java.lang.String sfile)
          Construct a P3D from a file.
 
Method Summary
 void add(double x, double dx, double y, double dy, double z, double dz)
          Adds values of a plot-point pair (X,dX,Y,dY,Z,dZ).
 void clear()
          Clear the container
 double[] getArrayX()
          Get array representing X-values
 double[] getArrayY()
          Get array representing Y-values
 double[] getArrayZ()
          Get array representing Z-values
 P3D getCopy()
          get a copy of the current holder
 jplot.DataArray3D getDataArray()
          Return a DataArray3D container.
 double getDX(int i)
          Return a specific dX-value.
 double getDY(int i)
          Return a specific dY-value.
 double getDZ(int i)
          Return a specific dZ-value.
 double getMax(int axis)
          Returns the maximum value in the range.
 double getMin(int axis)
          Returns the minimum value in the range.
 java.awt.Color getPenColor()
          get color attribute
 int getPenWidth()
          Get width of the lines
 java.lang.String getTitle()
          Get a new title
 double getX(int i)
          Return a specific X-value.
 double getY(int i)
          Return a specific Y-value.
 double getZ(int i)
          Return a specific Z-value.
 double meanX()
          Returns the mean value in X.
 double meanY()
          Returns the mean value in Y.
 double meanZ()
          Returns the mean value in Z.
 P3D merge(P3D a)
          Merge two P3D containers
 void print()
          Print a P3D container on the screen
 void set(int i, double x, double dx, double y, double dy, double z, double dz)
          Sets the values of (x,dx,y,dy,z,dz).
 void setDataArray(jplot.DataArray3D data)
          Set data in a form of DataArray
 void setPenColor(java.awt.Color c)
          Sets symbol color
 void setPenWidth(int w)
          Set width of the lines
 void setTitle(java.lang.String title)
          Set a new title
 int size()
          Return the length of the data vector.
 void toFile(java.lang.String name)
          Write a P3D to an external file.
 void toTable()
          Print the P2D container to a Table in a separate Frame.
 void toTable(boolean format)
          Print the P2D container to a Table in a separate Frame.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P3D

public P3D(java.lang.String title)
Construct an empty container with a title

Parameters:
title - New title

P3D

public P3D()
Construct an empty container with a title


P3D

public P3D(java.lang.String title,
           java.lang.String sfile)
Construct a P3D from a file. Data should be separated by space in 6 columns: X,dX,Y,dY,Z,dZ

Parameters:
title - Title of the container
sfile - File name with input
Method Detail

setTitle

public void setTitle(java.lang.String title)
Set a new title

Parameters:
title - New Title

getTitle

public java.lang.String getTitle()
Get a new title

Returns:
Title

getPenColor

public java.awt.Color getPenColor()
get color attribute

Returns:
Color

setPenColor

public void setPenColor(java.awt.Color c)
Sets symbol color

Parameters:
c - Color

setPenWidth

public void setPenWidth(int w)
Set width of the lines

Parameters:
w - Width of the lines

getPenWidth

public int getPenWidth()
Get width of the lines

Returns:
Width of the lines

toFile

public void toFile(java.lang.String name)
Write a P3D to an external file.

Parameters:
name - File name with output

print

public void print()
Print a P3D container on the screen


merge

public P3D merge(P3D a)
Merge two P3D containers

Parameters:
a - Container to be added
Returns:
New P3D container

setDataArray

public void setDataArray(jplot.DataArray3D data)
Set data in a form of DataArray

Parameters:
data - input data

getDataArray

public jplot.DataArray3D getDataArray()
Return a DataArray3D container.

Returns:
Container of type DataArray3D

add

public void add(double x,
                double dx,
                double y,
                double dy,
                double z,
                double dz)
Adds values of a plot-point pair (X,dX,Y,dY,Z,dZ).

Parameters:
x - X-value of the plot-point
dx - extention in X
y - Y-value of the plot-point
dy - extention in Y
z - Z-value of the plot-point
dz - extention in Z

set

public void set(int i,
                double x,
                double dx,
                double y,
                double dy,
                double z,
                double dz)
Sets the values of (x,dx,y,dy,z,dz).

Parameters:
i - index of the plot-point
x - X-value of the plot-point
dx - extention in X
y - Y-value of the plot-point
dy - extention in Y
z - Z-value of the plot-point
dz - extention in Z

size

public int size()
Return the length of the data vector.

Returns:
length of the PlotPoint vector

getCopy

public P3D getCopy()
get a copy of the current holder


getArrayX

public double[] getArrayX()
Get array representing X-values

Returns:
array with X values

getArrayY

public double[] getArrayY()
Get array representing Y-values

Returns:
array with Y values

getArrayZ

public double[] getArrayZ()
Get array representing Z-values

Returns:
array with Y values

getX

public double getX(int i)
Return a specific X-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of x at index i

getDX

public double getDX(int i)
Return a specific dX-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of dx at index i

getY

public double getY(int i)
Return a specific Y-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of y at index i

getDY

public double getDY(int i)
Return a specific dY-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of dy at index i

getZ

public double getZ(int i)
Return a specific Z-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of z at index i

getDZ

public double getDZ(int i)
Return a specific dZ-value. This function returns POSINF (1e300) if index i falls beyond the valid range.

Parameters:
i - index of the array
Returns:
the value of dz at index i

getMax

public double getMax(int axis)
Returns the maximum value in the range.

Parameters:
axis - defines to which axis this function applies. axis=0 - X, axis=1 - Y, axis=2 - Z,
Returns:
the maximum value.

getMin

public double getMin(int axis)
Returns the minimum value in the range. axis=0 - X, axis=1 - Y, axis=2 - Z.

Parameters:
axis - defines to which axis this function applies.
Returns:
the minimum value.

meanX

public double meanX()
Returns the mean value in X.

Returns:
Mean value in X

meanY

public double meanY()
Returns the mean value in Y.

Returns:
Mean value in Y

meanZ

public double meanZ()
Returns the mean value in Z.

Returns:
Mean value in Y

clear

public void clear()
Clear the container


toTable

public void toTable()
Print the P2D container to a Table in a separate Frame. The numbers are formatted to scientific format. One can sort and search the data in this table (but not modify)


toTable

public void toTable(boolean format)
Print the P2D container to a Table in a separate Frame. One can sort and search the data in this table (but not modify) #param format if false, numbers will not be formatted to scientific format ##.#####E00



jHepWork 1.1 (C) Chekanov