|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdevisor2.foundation.GridItem
devisor2.foundation.elements.Node
This class represents a node of a grid. As all foundation classes, a node can draw itself and provides convenience methods to support the GridListener and the GridSelector.
Field Summary | |
protected int[] |
coord
cartesian coordinates of the node |
protected int |
index
index of the node, read in mesh file |
protected int |
marker
marker variable |
protected int |
npr
boundary information variable |
protected int |
number
number of the node, updated by updateNodeNumbers() |
java.util.Vector |
parents
The edges which contains this node |
protected double[] |
value
The values of the node |
Fields inherited from class devisor2.foundation.GridItem |
cc, marked, transformed, xmax, xmin, ymax, ymin |
Constructor Summary | |
Node()
Creates a zero node |
|
Node(int xx,
int yy)
Creates a node at (x,y) without values |
|
Node(int xx,
int yy,
Edge p)
Creates a node at (x,y) in an edge p |
|
Node(int xx,
int yy,
int nbValues)
Creates a node at (x,y) with nbValues values |
Method Summary | |
void |
addParent(Edge p)
addParent adds the given edge p to the parent vector |
java.lang.Object |
clone()
creates a new Node with a copy of the data of this Node |
void |
draw(java.awt.Graphics g)
draws the node to Graphics context g |
boolean |
equals(Node n,
double eps)
determines if two nodes located at the same place |
boolean |
equals2(Node n,
double eps)
|
int[] |
getCoord()
gets the coordinate vector of the Node |
int |
getCoord(int i)
gets the coordinate i of the Node |
java.util.Vector |
getFathers()
|
int |
getMarker()
gets the marker of the node. |
int |
getNPR()
setNPR returns the nodal property |
int |
getNumber()
gets the number of the node. |
double[] |
getParameters()
returns all parameters of the griditem in an int array |
int[] |
getParams()
|
Edge[] |
getParents()
getParents() returns the parent edges as array of edges |
java.awt.Rectangle |
getPerimeter()
calculates the perimeter of this node. |
double |
getValue(int i)
gets an value of the node |
void |
interpolate(Node noeud1,
Node noeud2,
double coeff)
set an interpolated node between noeud1 and noeud2 related to parameter coeff |
boolean |
isHit(int x,
int y)
Has a node been hit by a click on the given coordinates? This method works in screen coordinates only because it is pure convenience for the GridSelector class. |
boolean |
isInside(int[] topleft,
int[] bottomright)
Are we inside of a give 2D area ? |
void |
performMirror(double nx,
double ny,
double px,
double py)
This method mirrors the node at the given line |
void |
performTransformation(GridTransformation trf)
applies the given affine transformation to the node |
boolean |
removeParent(Edge p)
delParent deletes the given edge p from the parent vector |
void |
setCoord(int[] xx)
setCoord sets the coordinates of the node |
void |
setCoord(int xx,
int yy)
setCoords sets the coordinates of the node |
void |
setCoord(int xx,
int yy,
int m)
setCoord sets the coordinates of the node and the marker |
void |
setCoord(Node n)
sets the coordinates of the actual node to the coordinates of Node n |
void |
setMarker(int n)
sets the marker of the node to n. |
void |
setNPR(int unpr)
setNPR sets the nodal property |
void |
setNumber(int i)
Sets the number of the node to i. |
void |
setParameters(double[] params)
sets the parameters to the given ones |
void |
setParams(int[] prm)
|
void |
setValue(int i,
double val)
Sets the values of the node |
java.lang.String |
toString()
prints the node's coordinates to the standard output |
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, wait, wait, wait |
Field Detail |
protected int[] coord
protected double[] value
public java.util.Vector parents
protected int number
protected int index
protected int marker
protected int npr
Constructor Detail |
public Node()
public Node(int xx, int yy)
public Node(int xx, int yy, Edge p)
public Node(int xx, int yy, int nbValues)
Method Detail |
public void setNPR(int unpr)
unpr
- nodal propertypublic int getNPR()
public Edge[] getParents()
public java.util.Vector getFathers()
public void addParent(Edge p)
public boolean removeParent(Edge p)
public double[] getParameters()
GridItem
getParameters
in class GridItem
public int[] getParams()
public void setParams(int[] prm)
public void setParameters(double[] params)
setParameters
in class GridItem
public void setNumber(int i)
public int getNumber()
public int getMarker()
public void setMarker(int n)
public void setCoord(int xx, int yy)
public void setCoord(int[] xx)
public void setCoord(int xx, int yy, int m)
public void setCoord(Node n)
n
- Node to be copied
public int[] getCoord()
public int getCoord(int i)
public void setValue(int i, double val)
i
- index of the value
public double getValue(int i)
i
- index of the value
public java.lang.Object clone()
public java.lang.String toString()
public void draw(java.awt.Graphics g)
draw
in class GridItem
public void interpolate(Node noeud1, Node noeud2, double coeff)
noeud1
- Node 1noeud2
- Node 2coeff
- Range
public boolean equals(Node n, double eps)
n
- nodeeps
- accuracy
public boolean equals2(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 x, int y)
isHit
in class GridItem
public java.awt.Rectangle getPerimeter()
getPerimeter
in class GridItem
public void performTransformation(GridTransformation trf)
performTransformation
in class GridItem
trf
- - homonenous world coordspublic void performMirror(double nx, double ny, double px, double py)
performMirror
in class GridItem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |