|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.graphstream.ui.graphicGraph.GraphPosLengthUtils
public class GraphPosLengthUtils
Lots of small often used measuring algorithms on graphs.
Use this class with a static import.
Constructor Summary | |
---|---|
GraphPosLengthUtils()
|
Method Summary | |
---|---|
static double |
edgeLength(Edge edge)
Like edgeLength(Graph,String) but use an existing edge as
argument. |
static double |
edgeLength(Graph graph,
String id)
Compute the edge length of the given edge according to its two nodes positions. |
static Point3 |
nodePointPosition(Graph graph,
String id)
Retrieve a node position from its attributes ("x", "y", "z", or "xy", or "xyz"). |
static Point3 |
nodePointPosition(Node node)
Like nodePointPosition(Graph,String) but use an existing node as
argument. |
static double[] |
nodePosition(Graph graph,
String id)
Retrieve a node position from its attributes ("x", "y", "z", or "xy", or "xyz"). |
static void |
nodePosition(Graph graph,
String id,
double[] xyz)
Like nodePosition(Graph,String) , but instead of returning a
newly allocated array, fill up the array given as parameter. |
static void |
nodePosition(Graph graph,
String id,
Point3 pos)
Like nodePointPosition(Graph,String) , but instead of returning a
newly allocated array, fill up the array given as parameter. |
static double[] |
nodePosition(Node node)
Like nodePosition(Graph,String) but use an existing node as
argument. |
static void |
nodePosition(Node node,
double[] xyz)
Like nodePosition(Graph,String,double[]) but use an existing node
as argument. |
static void |
nodePosition(Node node,
Point3 pos)
Like nodePosition(Graph,String,Point3) but use an existing node
as argument. |
static Node |
randomNode(Graph graph)
Choose a node at random. |
static Node |
randomNode(Graph graph,
Random random)
Choose a node at random. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GraphPosLengthUtils()
Method Detail |
---|
public static Node randomNode(Graph graph)
public static Node randomNode(Graph graph, Random random)
random
- The random number generator to use.
public static double[] nodePosition(Graph graph, String id)
id
- The node identifier.
public static Point3 nodePointPosition(Graph graph, String id)
id
- The node identifier.
public static double[] nodePosition(Node node)
nodePosition(Graph,String)
but use an existing node as
argument.
node
- The node to consider.
public static Point3 nodePointPosition(Node node)
nodePointPosition(Graph,String)
but use an existing node as
argument.
node
- The node to consider.
public static void nodePosition(Graph graph, String id, double[] xyz)
nodePosition(Graph,String)
, but instead of returning a
newly allocated array, fill up the array given as parameter. This array
must have at least three cells.
id
- The node identifier.xyz
- An array of at least three cells.
RuntimeException
- If the node with the given identifier does not exist.public static void nodePosition(Graph graph, String id, Point3 pos)
nodePointPosition(Graph,String)
, but instead of returning a
newly allocated array, fill up the array given as parameter. This array
must have at least three cells.
id
- The node identifier.pos
- A point that will receive the node position.
RuntimeException
- If the node with the given identifier does not exist.public static void nodePosition(Node node, double[] xyz)
nodePosition(Graph,String,double[])
but use an existing node
as argument.
node
- The node to consider.xyz
- An array of at least three cells.public static void nodePosition(Node node, Point3 pos)
nodePosition(Graph,String,Point3)
but use an existing node
as argument.
node
- The node to consider.pos
- A point that will receive the node position.public static double edgeLength(Graph graph, String id)
id
- The identifier of the edge.
RuntimeException
- If the edge cannot be found.public static double edgeLength(Edge edge)
edgeLength(Graph,String)
but use an existing edge as
argument.
edge
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |