public class BasicLineGraphGenerator extends Object implements LineGraphGenerator
BasicXYNode,
BasicEdge,
LineSegment,
Coordinate| Constructor and Description |
|---|
BasicLineGraphGenerator()
Constructs a new BasicLineGraphGenerator.
|
BasicLineGraphGenerator(double tolerance)
Constructs a new BasicLineGraphGenerator.
|
| Modifier and Type | Method and Description |
|---|---|
Graphable |
add(Object obj)
Adds a line to the graph.
|
protected LineSegment |
alterLine(LineSegment line,
Node n1,
Node n2) |
Graphable |
get(Object obj)
Returns the edge which represents a line.
|
Edge |
getEdge(Coordinate c1,
Coordinate c2)
Retrieve edge between the two coordinates.
|
Graph |
getGraph()
Returns the graph being generated.
|
GraphBuilder |
getGraphBuilder()
Returns the underlying builder.
|
Node |
getNode(Coordinate c)
Look up a Node for the provided coordinate.
|
Map |
getNodeMap()
Returns the coordinate to node map used to build nodes representing line endpoint
coordinates.
|
Graphable |
remove(Object obj)
Removes the edge from the graph that represents a line.
|
void |
setGraphBuilder(GraphBuilder builder)
Sets the underlying builder used to physically construct the graph.
|
protected void |
setObject(Edge e,
Object obj) |
protected void |
setObject(Node n,
Object obj) |
protected boolean |
useTolerance() |
public BasicLineGraphGenerator()
Tolerance is 0.0 as default, meaning coordinates must be equal for lines to connect at a node.
public BasicLineGraphGenerator(double tolerance)
If two coordinates are considered equal (and should be snapped to the same Node), the distance between them must be less than the tolerance value.
tolerance - threshold distance value for coordinates to be considered equalpublic Graphable add(Object obj)
add in interface GraphGeneratorobj - An instance of LineSegment.LineSegment,
GraphGenerator.add(Object)public Graphable get(Object obj)
get in interface GraphGeneratorobj - An instance of LineSegment.GraphGenerator.get(Object)public Graphable remove(Object obj)
remove in interface GraphGeneratorobj - The object modelled by the component.GraphGenerator.remove(Object)public void setGraphBuilder(GraphBuilder builder)
GraphGeneratorsetGraphBuilder in interface GraphGeneratorbuilder - The new underlying GraphBuilder.GraphGenerator.setGraphBuilder(GraphBuilder)public GraphBuilder getGraphBuilder()
GraphGeneratorgetGraphBuilder in interface GraphGeneratorGraphGenerator.getGraphBuilder()public Graph getGraph()
GraphGeneratorgetGraph in interface GraphGeneratorGraphGenerator.getGraph()public Map getNodeMap()
public Node getNode(Coordinate c)
LineGraphGeneratorgetNode in interface LineGraphGeneratorpublic Edge getEdge(Coordinate c1, Coordinate c2)
LineGraphGeneratorgetEdge in interface LineGraphGeneratorprotected boolean useTolerance()
Copyright © 1996–2019 Geotools. All rights reserved.