|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdevisor2.foundation.GridItem
devisor2.foundation.elements.Edge
This class represents the GridItem extension for edges. Edges are defined via two nodes and can carry additional properties such as edge stati etc. Edges form the top-level elements.
Field Summary | |
static int |
BC_DIRICHLET
Constant for boundary condition DIRICHLET |
static int |
BC_NEUMANN
Constant for boundary condition NEUMANN |
static int |
BC_NONE
Constant for boundary condition NONE |
protected Boundary |
boundary
if boundary Edge then contains the boundary of the edge |
protected boolean |
boundaryEdge
Boundary Edge or not |
protected int |
edgebc
boundary condition of the edge (use constants provided) |
protected int |
edgestatus
Status of the edge (use constants provided) |
int |
level
the hierarchical level of this edge (yet not implemented) |
int |
marker
marker of this edge |
protected int |
number
the number of this edge, updated by updateEdgeNumbers() |
protected Node[] |
p
the nodes of this edge |
protected java.util.Vector |
parents
The Cell2D Objects which contain this edge |
static int |
STATUS_INNER
Constant for edge status INNER |
static int |
STATUS_MIRRORB
Constant for edge status MIRROR BOUNDARY |
static int |
STATUS_NONE
Constant for edge status NONE |
static int |
STATUS_REAL
Constant for edge status REAL |
Fields inherited from class devisor2.foundation.GridItem |
cc, marked, transformed, xmax, xmin, ymax, ymin |
Constructor Summary | |
Edge(Node n1,
Node n2)
creates an edge from node a to b |
|
Edge(Node n1,
Node n2,
int es)
|
|
Edge(Node n1,
Node n2,
int es,
int bc)
|
Method Summary | |
void |
addParent(Cell2D c)
addParent adds the given Cell2D c to the parent vector |
java.lang.Object |
clone()
returns an exact copy of this edge, but not cloning recursively (i.e. |
void |
draw(java.awt.Graphics g)
draw this edge with respect to transformation and drawcontrol |
void |
fill(java.awt.Graphics g)
fill this edge with its color with respect to transformation and drawcontrol |
int |
getBC()
returns the boundarycondition of the edge |
java.util.Vector |
getFathers()
|
double |
getLength()
calculates the length of the edge (simple pythagoras) and returns it |
int |
getMarker()
returns the marker value of this edge |
Node |
getNode(int i)
returns the i-th Node (0 or 1) of this edge |
double |
getNodeAverageValue(int index)
Returns the average of the ith value of the nodes defining this cell. |
int |
getNumber()
returns the number of the edge |
double[] |
getParameters()
returns all parameters of the griditem in an int array |
java.lang.Object[] |
getParents()
getParents() returns the parent Cells(2D) as array of Objects |
java.awt.Rectangle |
getPerimeter()
returns the perimeter of the Edge element, that is the smallest bounding box completely containing the Edge |
int |
getStatus()
returns the status of the edge |
boolean |
isHit(int cx,
int cy)
Determines if the item has been hit by a click on the grid ALL IN world COORDINATES to avoid the snap mechanism |
boolean |
isInside(int[] topleft,
int[] bottomright)
Is the item inside a given rectangular area? All in WORLD COORDINATES!!! |
boolean |
isOnEdge(Node n,
double eps)
|
void |
performMirror(double nx,
double ny,
double px,
double py)
This method mirrors the edge at the given line (by mirroring its two nodes) |
void |
performTransformation(GridTransformation trafo)
applies the given AffineTransform instance on this edge |
void |
reinit(Node n1,
Node n2,
int es,
int bc)
Pseudo constructor |
void |
removeParent(Cell c)
|
void |
removeParent(Cell2D c)
removeParent removes the given Cell2D c from the parent vector |
void |
setBC(int newbc)
sets the boundary condition |
void |
setMarker(int i)
sets the marker value to i |
void |
setNode(int i,
Node n)
sets the i-th node of the edge to n |
void |
setNumber(int i)
defines the number of the edge |
void |
setParameters(double[] params)
sets all parameters of the GridItem according to the given int array |
void |
setStatus(int newstatus)
sets the status of the edge |
void |
swap()
changes the orientation of this edge |
void |
updateInnerData()
updates the inner variables of the edge used for picking and selecting |
Methods inherited from class devisor2.foundation.GridItem |
clearTransformedFlag, isMarked, setMarker, setMarker, unsetMarker |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Node[] p
protected int number
public int level
public int marker
protected java.util.Vector parents
protected int edgestatus
public static final int STATUS_NONE
public static final int STATUS_INNER
public static final int STATUS_REAL
public static final int STATUS_MIRRORB
protected int edgebc
public static final int BC_NONE
public static final int BC_NEUMANN
public static final int BC_DIRICHLET
protected boolean boundaryEdge
protected Boundary boundary
Constructor Detail |
public Edge(Node n1, Node n2)
public Edge(Node n1, Node n2, int es)
public Edge(Node n1, Node n2, int es, int bc)
Method Detail |
public double[] getParameters()
GridItem
getParameters
in class GridItem
public void setParameters(double[] params)
GridItem
setParameters
in class GridItem
public void setNode(int i, Node n)
public void reinit(Node n1, Node n2, int es, int bc)
public void swap()
public int getStatus()
public void setStatus(int newstatus)
public int getBC()
public void setBC(int newbc)
public void setMarker(int i)
public int getMarker()
public Node getNode(int i)
public void setNumber(int i)
public int getNumber()
public void addParent(Cell2D c)
public void removeParent(Cell2D c)
public void removeParent(Cell c)
public java.lang.Object[] getParents()
public java.util.Vector getFathers()
public double getNodeAverageValue(int index)
public void updateInnerData()
public void draw(java.awt.Graphics g)
draw
in class GridItem
public void fill(java.awt.Graphics g)
public boolean isOnEdge(Node n, double eps)
public boolean isInside(int[] topleft, int[] bottomright)
isInside
in class GridItem
topleft
- - the topleft corner of the rectanglebottomright
- - the bottom right corner of the rectangle
public boolean isHit(int cx, int cy)
isHit
in class GridItem
public java.awt.Rectangle getPerimeter()
getPerimeter
in class GridItem
public void performTransformation(GridTransformation trafo)
performTransformation
in class GridItem
trafo
- - the GridTransform instance representing the
transformationpublic void performMirror(double nx, double ny, double px, double py)
performMirror
in class GridItem
public java.lang.Object clone()
public double getLength()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |