|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectmoebiusViewer.shape.AbstractShape
moebiusViewer.shape.Grid
A Grid is a 2-dimensional quadrilateral mesh. In order to handle families of closed curves, there is a flag
isClosedto determine whether the rows are to be considered as closed curves (we saw no need for doubly periodic grids)
| Field Summary | |
double[][] |
im
|
double[][] |
re
|
| Fields inherited from class moebiusViewer.shape.AbstractShape |
EPS, EPSSQR, propertyChangeSupport, toolList |
| Constructor Summary | |
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) |
|
| Method Summary | |
void |
draw(MoebiusGraphics context)
Draws the grid |
Complex[][] |
getCoords()
Returns the coordinates as a freshly created Complex array |
void |
getCoords(Complex[][] pts,
int i0,
int j0)
writes the coordinates between row |
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 |
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,
Complex z)
Writes the coordinate in row |
Complex[][] |
getProjectiveCoords(int i0,
int j0,
int i1,
int j1)
Returns the coordinates in the intersection of the integer rectangle |
Complex[] |
getRow(int i)
|
void |
makeRuled()
Equivalent to |
void |
makeRuled(int startRow,
int endRow)
Does nothing unless |
void |
setCoords(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,
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,
Complex[] pts)
First sets the number of colums to the length of |
| Methods inherited from class moebiusViewer.shape.AbstractShape |
addPropertyChangeListener, clone, dontFirePropertyChange, equals, firePropertyChange, firePropertyChange, getColor, getFilled, getLabel, getLineWidth, getPickable, getPointOutline, getPointRadius, getShowLabel, getString, getTools, isDoFirePropertyChange, isPickable, removePropertyChangeListener, reset, setColor, setDoFirePropertyChange, setFilled, setLabel, setLineWidth, setPickable, setPointOutline, setPointRadius, setShowLabel |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public double[][] re
public double[][] im
| Constructor Detail |
public Grid()
public Grid(int m,
int n)
| Method Detail |
public int getNumRows()
public void setNumRows(int newNumRows)
setNumRows(n)is equivalent to
setNumRows(1)if n is less than 1.
public int getNumColums()
public void setNumColums(int newNumCols)
setNumColums(n)is equivalent to
setNumRows(1)if n is less than 1.
public Complex[] getRow(int i)
public Complex[] getInterpolatedRow(double t)
public void setRow(int i,
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.
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 makeRuled()
makeRuled(0, numRows - 1). Makes the whole grid ruled
public boolean getIsClosed()
public void setIsClosed(boolean v)
public 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 Complex array
public Complex[][] getCoords()
public void getCoords(Complex[][] pts,
int i0,
int j0)
i0 and
row i0+pts.length
and between colum j0
and
j0+pts[0].length
into the array pts
. Produces
index out of bound exceptions if some of these indices are invalid
public Complex getCoords(int i,
int j)
i, colum
jas a freshly created Complex
public void getProjectiveCoords(int i,
int j,
Complex z)
i, colum
jinto the 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 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 setProjectiveCoords(int i,
int j,
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 setCoords(Complex[][] pts)
public void draw(MoebiusGraphics context)
draw in interface MoebiusShapedraw in class AbstractShapepublic boolean getDrawHorizontalLines()
public void setDrawHorizontalLines(boolean b)
public boolean getDrawVerticalLines()
public void setDrawVerticalLines(boolean b)
public boolean getDrawPoints()
public void setDrawPoints(boolean b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||