public class GeometricGraph_2 extends AdjacencyListGraph<Node<Point_2>> implements GeometricGraph<Point_2>
vertices
Constructor and Description |
---|
GeometricGraph_2()
Create a new graph
|
GeometricGraph_2(int n)
Create a graph of size n
|
Modifier and Type | Method and Description |
---|---|
void |
addNode(Point_2 p)
Add a new vertex to the graph (with its geometric coordinates)
|
Point_2[] |
boundingBox()
compute and return the bounding box for the points set.
|
java.util.List<Point_2[]> |
computeEdges()
Return the list of edges of the graph (their corresponding segments)
|
Point_2 |
getPoint(Node<Point_2> v)
Return the geometric coordinates of a vertex
|
Point_2[] |
getSegment(Node<Point_2> u,
Node<Point_2> v)
Return the straight-line segment having as extremities two given vertices of the graph
|
java.util.ArrayList<Point_2> |
listOfPoints()
Return the list of vertex points of the graph
|
void |
setPoint(Node<Point_2> v,
Point_2 p)
Set the geometric coordinates of a vertex
|
addEdge, addNode, adjacent, degree, getNeighbors, removeEdge, removeNode, sizeVertices
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEdge, addNode, adjacent, degree, getNeighbors, removeEdge, removeNode, sizeVertices
public GeometricGraph_2()
public GeometricGraph_2(int n)
n
- the number of verticespublic void setPoint(Node<Point_2> v, Point_2 p)
setPoint
in interface GeometricGraph<Point_2>
public Point_2 getPoint(Node<Point_2> v)
getPoint
in interface GeometricGraph<Point_2>
v
- a vertex in the graphpublic void addNode(Point_2 p)
addNode
in interface GeometricGraph<Point_2>
p
- the coordinates of the vertex to addpublic Point_2[] boundingBox()
boundingBox
in interface GeometricGraph<Point_2>
public java.util.List<Point_2[]> computeEdges()
public java.util.ArrayList<Point_2> listOfPoints()
listOfPoints
in interface GeometricGraph<Point_2>