|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgeometry.object.SkeletonGraph
public class SkeletonGraph
A skeleton graph is a reduction of the skeleton to only end nodes and
junction nodes. The vertices of the graph are the end nodes and junction
nodes, respectively. Two vertices in the skeleton graph are connected if
there exists a skeleton branch (see SkeletonBranch) between them. The
edge weight is given by the length of the corresponding skeleton part. This
data structure is needed mostly for searching the shortest paths in the
skeleton to create the skeleton paths.
| Field Summary | |
|---|---|
private org.jgrapht.graph.SimpleDirectedWeightedGraph<SkeletonNode,SkeletonBranch> |
graph
the "real" skeleton graph |
private org.apache.log4j.Logger |
logger
logger instance |
| Constructor Summary | |
|---|---|
SkeletonGraph()
constructor. |
|
| Method Summary | |
|---|---|
boolean |
addEdge(SkeletonBranch part)
add the specified edge (defined by the SkeletonBranch to the
graph. |
boolean |
addVertex(SkeletonNode node)
Add a new vertex to the graph. |
void |
deleteUnconnectedComponents()
If the skeleton graph is not connected, the unconnected parts are deleted. |
java.util.List<SkeletonNode> |
getAllVertexNeighbors(SkeletonNode node)
Get all vertices in the graph directly connected to the specified vertex. |
java.util.Set<SkeletonNode> |
getAllVertices()
Get all vertices in this graph. |
java.util.Set<SkeletonBranch> |
getOutgoingEdges(SkeletonNode node)
return the edges emanating from the specified node |
SkeletonPath |
getShortestPath(SkeletonNode start,
SkeletonNode end)
Get the shortest path in the graph from the specified start node to the specified end node. |
boolean |
removeVertex(SkeletonNode node)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final org.jgrapht.graph.SimpleDirectedWeightedGraph<SkeletonNode,SkeletonBranch> graph
private final org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public SkeletonGraph()
| Method Detail |
|---|
public boolean addVertex(SkeletonNode node)
node - - the vertex to be added
public boolean removeVertex(SkeletonNode node)
public boolean addEdge(SkeletonBranch part)
SkeletonBranch to the
graph. Start and end vertex of the edge are extracted from the specified
skeleton part.
part - the edge to be added
public java.util.List<SkeletonNode> getAllVertexNeighbors(SkeletonNode node)
node - - the vertex to get the neighbor for
public void deleteUnconnectedComponents()
First, the "main skeleton graph" is found: The biggest connected graph component is seen as "main skeleton". Then, all vertices that are not connected to the main skeleton, and therewith all connected edges with these vertices are deleted.
public java.util.Set<SkeletonNode> getAllVertices()
public SkeletonPath getShortestPath(SkeletonNode start,
SkeletonNode end)
start - the start nodeend - the end node
SkeletonPath from start to endpublic java.util.Set<SkeletonBranch> getOutgoingEdges(SkeletonNode node)
node -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||