public abstract class NodeParticle
extends Particle
BarnesHutLayout
to represent nodes and choose their positions.
Several abstract methods have to be overrided to provide a computation of the layout (all the attraction/repulsion computation is done in this class):
Modifier and Type | Field and Description |
---|---|
double |
attE
Attraction energy for this node only.
|
Vector3 |
disp
Displacement vector.
|
boolean |
frozen
Should the node move?.
|
double |
len
Last computed displacement vector length.
|
java.util.ArrayList<EdgeSpring> |
neighbours
Set of edge connected to this node.
|
java.io.PrintStream |
out
If non null, all this node statistics will be output to this stream.
|
double |
repE
Repulsion energy for this node only.
|
Constructor and Description |
---|
NodeParticle(BarnesHutLayout box,
java.lang.String id)
New node.
|
NodeParticle(BarnesHutLayout box,
java.lang.String id,
double x,
double y,
double z)
New node at a given position.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<EdgeSpring> |
getEdges()
All the edges connected to this node.
|
void |
inserted() |
void |
move(int time) |
void |
moveOf(double dx,
double dy,
double dz)
Force a node to move from a given vector.
|
void |
moveTo(double x,
double y,
double z)
Force a node to move at a given position.
|
void |
nextStep(int time) |
void |
registerEdge(EdgeSpring e)
The given edge is connected to this node.
|
void |
removed() |
void |
removeNeighborEdges()
Remove all edges connected to this node.
|
void |
unregisterEdge(EdgeSpring e)
The given edge is no more connected to this node.
|
public java.util.ArrayList<EdgeSpring> neighbours
public boolean frozen
public Vector3 disp
public double len
public double attE
public double repE
public java.io.PrintStream out
public NodeParticle(BarnesHutLayout box, java.lang.String id)
box
- The spring box.id
- The node identifier.public NodeParticle(BarnesHutLayout box, java.lang.String id, double x, double y, double z)
box
- The spring box.id
- The node identifier.x
- The abscissa.y
- The ordinate.z
- The depth.public java.util.Collection<EdgeSpring> getEdges()
public void move(int time)
public void nextStep(int time)
public void moveOf(double dx, double dy, double dz)
dx
- The x component.dy
- The y component.dz
- The z component.public void moveTo(double x, double y, double z)
x
- The new x.y
- The new y.z
- The new z.public void registerEdge(EdgeSpring e)
e
- The edge to connect.public void unregisterEdge(EdgeSpring e)
e
- THe edge to disconnect.public void removeNeighborEdges()
public void inserted()
public void removed()