public class Grid extends AbstractShape
isClosedto determine whether the rows are to be considered as closed curves (we saw no need for doubly periodic grids)
Modifier and Type | Field and Description |
---|---|
double[][] |
im |
double[][] |
re |
EPS, EPSSQR, moebiusShapeChangeSupport, propertyChangeSupport, toolList
Constructor and Description |
---|
Grid()
Creates a Grid with 1 row, 1 colum, located at the zero
|
Grid(int m,
int n)
Creates a Grid with integer coordinates, lower left corner at (0,0),
upper right corner at (m,n)
|
Modifier and Type | Method and Description |
---|---|
void |
draw(MoebiusGraphics context)
Draws the grid
|
de.jtem.mfc.field.Complex[][] |
getCoords()
Returns the coordinates as a freshly created Field.Complex array
|
void |
getCoords(de.jtem.mfc.field.Complex[][] pts,
int i0,
int j0)
writes the coordinates between row
|
de.jtem.mfc.field.Complex |
getCoords(int i,
int j)
Returns the coordinate in row
|
boolean |
getDrawHorizontalLines()
Returns the boolean that determines whether the horizontal lines
are drawn
|
boolean |
getDrawPoints()
Returns the boolean that determines whether the points are drawn
|
boolean |
getDrawVerticalLines()
Returns the boolean that determines whether the vertical lines
are drawn
|
de.jtem.mfc.field.Complex[] |
getInterpolatedRow(double t) |
boolean |
getIsClosed()
Returns the boolean that tells whether horizontal curves are to be
treated as closed
|
int |
getNumColums()
Returns the number of colums
|
int |
getNumRows()
Returns the number of Rows
|
void |
getProjectiveCoords(int i,
int j,
de.jtem.mfc.field.Complex z)
Writes the coordinate in row
|
de.jtem.mfc.field.Complex[][] |
getProjectiveCoords(int i0,
int j0,
int i1,
int j1)
Returns the coordinates in the intersection of the integer rectangle
|
de.jtem.mfc.field.Complex[] |
getRow(int i) |
void |
makeRuled()
Equivalent to
|
void |
makeRuled(int startRow,
int endRow)
Does nothing unless
|
void |
setCoords(de.jtem.mfc.field.Complex[][] pts)
Sets the dimensions of the grid to the dimensions of pts and uses
the entries of pts (as far as they are non-null) as coordinates.
|
void |
setDrawHorizontalLines(boolean b)
Sets the boolean that determines whether the horizontal lines
are drawn
|
void |
setDrawPoints(boolean b)
Sets the boolean that determines whether the points are drawn
|
void |
setDrawVerticalLines(boolean b)
Sets the boolean that determines whether the vertical lines
are drawn
|
void |
setIsClosed(boolean v)
Sets the boolean that tells whether horizontal curves are to be
treated as closed
|
void |
setNumColums(int newNumCols)
Change the number of colums, by truncation if the number of colums is
getting smaller, by linear extrapolation if it is getting bigger.
|
void |
setNumRows(int newNumRows)
Change the number of rows, by truncation if the number of rows is
getting smaller, by linear extrapolation if it is getting bigger.
|
void |
setProjectiveCoords(int i,
int j,
de.jtem.mfc.field.Complex p)
Sets the coordinate in row
|
void |
setProjectiveCoords(int i,
int j,
double a,
double b)
Sets the coordinate in row
|
void |
setRow(int i,
de.jtem.mfc.field.Complex[] pts)
First sets the number of colums to the length of
|
addMoebiusShapeChangeListener, addPropertyChangeListener, clone, dontFirePropertyChange, equals, fireMoebiusShapeChange, fireMoebiusShapeChange, firePropertyChange, firePropertyChange, getColor, getFilled, getLabel, getLineWidth, getPickable, getPointOutline, getPointRadius, getShowLabel, getString, getTools, isDoFirePropertyChange, isPickable, removeMoebiusShapeChangeListener, removePropertyChangeListener, reset, setColor, setDoFirePropertyChange, setFilled, setLabel, setLineWidth, setPickable, setPointOutline, setPointRadius, setShowLabel
public Grid()
public Grid(int m, int n)
public void draw(MoebiusGraphics context)
draw
in interface MoebiusShape
draw
in class AbstractShape
public de.jtem.mfc.field.Complex[][] getCoords()
public void getCoords(de.jtem.mfc.field.Complex[][] pts, int i0, int j0)
i0and rowi0+pts.lengthand between columj0andj0+pts[0].lengthinto the arraypts. Produces index out of bound exceptions if some of these indices are invalid
public de.jtem.mfc.field.Complex getCoords(int i, int j)
i, colum
jas a freshly created Field.Complex
public boolean getDrawHorizontalLines()
public boolean getDrawPoints()
public boolean getDrawVerticalLines()
public de.jtem.mfc.field.Complex[] getInterpolatedRow(double t)
public boolean getIsClosed()
public int getNumColums()
public int getNumRows()
public void getProjectiveCoords(int i, int j, de.jtem.mfc.field.Complex z)
i, colum
jinto the Field.Complex number z. Will produce index out of bound exceptions if either
idoes not refer to an existing row or if the grid is not closed and
jpoints to a non-existing colum
public de.jtem.mfc.field.Complex[][] getProjectiveCoords(int i0, int j0, int i1, int j1)
[i0,i1] x [j0,j1]with the grids own index rectangle as a freshly created Field.Complex array
public de.jtem.mfc.field.Complex[] getRow(int i)
public void makeRuled()
makeRuled(0, numRows - 1). Makes the whole grid ruled
public void makeRuled(int startRow, int endRow)
ptsare existing rows. The in-between rows are set by linear interpolation, so the vertical curves are ruled (straight) in this region.
public void setCoords(de.jtem.mfc.field.Complex[][] pts)
public void setDrawHorizontalLines(boolean b)
public void setDrawPoints(boolean b)
public void setDrawVerticalLines(boolean b)
public void setIsClosed(boolean v)
public void setNumColums(int newNumCols)
setNumColums(n)is equivalent to
setNumRows(1)if n is less than 1.
public void setNumRows(int newNumRows)
setNumRows(n)is equivalent to
setNumRows(1)if n is less than 1.
public void setProjectiveCoords(int i, int j, de.jtem.mfc.field.Complex p)
i, colum
jWill produce index out of bound exceptions if either
idoes not refer to an existing row or if the grid is not closed and
jpoints to a non-existing colum
public void setProjectiveCoords(int i, int j, double a, double b)
i, colum
jWill produce index out of bound exceptions if either
idoes not refer to an existing row or if the grid is not closed and
jpoints to a non-existing colum
public void setRow(int i, de.jtem.mfc.field.Complex[] pts)
pts. If
iis the index of an existing row, pts is copied to the coordinates of the i'th row. Otherwise, the number of rows is first set to
i+1. If
iis larger than
numRows+1, the in-between rows are filled by linear interpolation.
setRow(i,pts)does nothing for negative i or arrays pts of length 0.