|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdevisor2.foundation.GridItem
devisor2.foundation.elements.Cell
devisor2.foundation.elements.Cell2D
The class Cell2D provides a ground class for 2D cell types which defines a discrete 2D domain. This class is abstract and must be derived.
Quad
,
Tri
,
Line
,
MacroQuad
,
Serialized FormField Summary | |
protected Edge[] |
edges
Face of the cell |
protected java.awt.Polygon |
poly_world
the cell representation as a Polygon in user coordinates |
Fields inherited from class devisor2.foundation.elements.Cell |
children, level, marker, material_number, matrixblock, neighbours, nodes, number, parallelblock, parameters, parent, values |
Fields inherited from class devisor2.foundation.GridItem |
cc, marked, transformed, xmax, xmin, ymax, ymin |
Constructor Summary | |
Cell2D()
Empty Constructor. |
|
Cell2D(int i)
creates a cell with number i |
Method Summary | |
abstract java.lang.Object |
clone()
|
abstract void |
draw(java.awt.Graphics g)
in this method, the item paints itself to the given graphics context |
abstract double |
getArea()
calculates and returns the area (size) of the element |
abstract double |
getAspectRatio()
calculates the aspect ratio of the element, that is the quotient of the shortest and the longest edge |
abstract Edge |
getEdge(int i)
gives the ith Edge of the cell |
Edge[] |
getEdges()
|
Node |
getNode(int i)
gives the ith node of the cell |
Node[] |
getNodes()
gives the node array of the cell |
abstract java.awt.Rectangle |
getPerimeter()
This method returns the perimeter of the item, that is the smallest bounding rectangle the item lies is completely inside of. |
abstract double |
getSmallestInnerAngle()
calculates and returns the smallest inner angle of the element. |
abstract boolean |
isHit(int x,
int y)
Determines if the item has been hit by a click on the grid ALL IN SCREEN COORDINATES to avoid the snap mechanism |
abstract boolean |
isInside(int[] topleft,
int[] bottomright)
Is the item inside a given rectangular area? All in WORLD COORDINATES!!! |
abstract void |
performTransformation(GridTransformation trafo)
This method performs the given affine transformation (in homogenous world coordinates) on the grid item and updates its position and appearance |
void |
setCell(Edge[] e)
Defines the edges of the cell, and set the number of the cell to 0. |
void |
setCell(int i,
Edge[] e)
Defines the edges of the cell, and set the number of the cell to i. |
void |
setEdge(int i,
Edge e)
sets the i-th edge of the cell to e |
void |
setNode(Node n,
int index)
|
Cell[] |
updateCellNeighbours()
update the neighbours array of this cell |
Node[] |
updateCellNodes()
returns the nodes of this cell with respect to the edge order. |
abstract void |
updateInnerData()
|
Methods inherited from class devisor2.foundation.elements.Cell |
defValue, fill, getChildren, getLevel, getMarker, getMatrixBlock, getNeighbours, getNodeAverageValue, getNPT, getNumber, getParallelBlock, getParent, getValue, isRect, setLevel, setMarker, setMatrixBlock, setNumber, setParallelBlock, setValue |
Methods inherited from class devisor2.foundation.GridItem |
clearTransformedFlag, getParameters, isMarked, performMirror, setMarker, setMarker, setParameters, unsetMarker |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.awt.Polygon poly_world
protected Edge[] edges
Face
Constructor Detail |
public Cell2D()
public Cell2D(int i)
i
- - the new number tof the Cell to be createdMethod Detail |
public void setNode(Node n, int index)
n
- - the new node to be placed atpublic void setCell(int i, Edge[] e)
Face
,
Cell
public void setCell(Edge[] e)
Face
,
Cell
public void setEdge(int i, Edge e)
public Edge[] getEdges()
public abstract void updateInnerData()
public Node[] updateCellNodes()
updateCellNodes
in class Cell
public Cell[] updateCellNeighbours()
updateCellNeighbours
in class Cell
public Node getNode(int i)
public Node[] getNodes()
getNodes
in class Cell
public abstract Edge getEdge(int i)
public abstract void draw(java.awt.Graphics g)
draw
in class Cell
public abstract boolean isInside(int[] topleft, int[] bottomright)
isInside
in class Cell
topleft
- - the topleft corner of the rectanglebottomright
- - the bottom right corner of the rectangle
public abstract boolean isHit(int x, int y)
isHit
in class Cell
public abstract java.awt.Rectangle getPerimeter()
GridItem
getPerimeter
in class Cell
public abstract void performTransformation(GridTransformation trafo)
GridItem
performTransformation
in class Cell
public abstract java.lang.Object clone()
public abstract double getSmallestInnerAngle()
public abstract double getAspectRatio()
public abstract double getArea()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |