geometry.object
Class SkeletonPath

java.lang.Object
  extended by geometry.object.SkeletonPath
All Implemented Interfaces:
java.lang.Comparable<SkeletonPath>

public class SkeletonPath
extends java.lang.Object
implements java.lang.Comparable<SkeletonPath>

A skeleton path between a pair of end nodes is defined as the shortest path between those endnodes with the limitation, that all points in between have to be skeleton points.

Thus, a skeleton path is defined by the two enclosing skeleton points, which are both end nodes, and the skeleton nodes lying on the path between these two points.


Field Summary
private  java.util.List<SkeletonNode> allNodes
          a list containing all nodes on this skeleton path
private  SkeletonNode endnode1
          the skeleton path's first end node (the start point)
private  SkeletonNode endnode2
          the skeleton path's second end node (the end point)
private  org.apache.log4j.Logger logger
          logger instance
private  double pathLenght
          the skeleton path'S length (that is, the number of nodes on this path
private  double[] vectorRepresentation
          a special vector representation for skeleton paths, see SkeletonPathGetter
 
Constructor Summary
SkeletonPath(SkeletonNode endnode1, SkeletonNode endnode2)
          Constructor.
 
Method Summary
 int compareTo(SkeletonPath arg0)
           
 boolean equals(SkeletonPath path)
          check if two skeleton paths are equal.
 java.util.List<SkeletonNode> getAllIncludedSkeletonPoints()
          get a list of all skeletonnodes included in this path, but without end nodes.
 java.util.List<SkeletonNode> getAllNodes()
          Get the list of all skeleton nodes on this path.
 SkeletonNode getEndnode1()
          Get the skeleton path's first end node.
 SkeletonNode getEndnode2()
          Get the skeleton path's second end node.
 double getPathLength()
          get this skeleton path's length, that is, the number of skeleton nodes on this path.
 double[] getVectorRepresentation()
          Get the skeleton path vector representation.
 void setAllNodes(java.util.List<SkeletonNode> allNodes)
          Set all nodes on this skeleton path.
 void setEndnode1(SkeletonNode endnode1)
          Set the skeleton path's first end node.
 void setEndnode2(SkeletonNode endnode2)
          Set the skeleton path's second end node.
 void setVectorRepresentation(double[] vectorRepresentation)
          Set the skeleton path vector representation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

allNodes

private java.util.List<SkeletonNode> allNodes
a list containing all nodes on this skeleton path


endnode1

private SkeletonNode endnode1
the skeleton path's first end node (the start point)


endnode2

private SkeletonNode endnode2
the skeleton path's second end node (the end point)


logger

private final org.apache.log4j.Logger logger
logger instance


pathLenght

private double pathLenght
the skeleton path'S length (that is, the number of nodes on this path


vectorRepresentation

private double[] vectorRepresentation
a special vector representation for skeleton paths, see SkeletonPathGetter

Constructor Detail

SkeletonPath

public SkeletonPath(SkeletonNode endnode1,
                    SkeletonNode endnode2)
Constructor. Create a new skeleton path between the two specified end nodes.

Parameters:
endnode1 - the skeleton path's first endnode
endnode2 - the skeleton path's second endnode
Method Detail

equals

public boolean equals(SkeletonPath path)
               throws InvalidSkeletonException
check if two skeleton paths are equal.

two skeleton paths are assumed as equal if both start- and end point are equal.

Parameters:
path - the skeleton path to be compared
Returns:
true if the two paths are equal, false if not
Throws:
InvalidSkeletonException - if one of the nodes is ambiguously end node and true skeleton node

getAllIncludedSkeletonPoints

public java.util.List<SkeletonNode> getAllIncludedSkeletonPoints()
get a list of all skeletonnodes included in this path, but without end nodes.

Returns:
a list of all skeleton points on this path

getAllNodes

public java.util.List<SkeletonNode> getAllNodes()
                                         throws InvalidSkeletonException
Get the list of all skeleton nodes on this path.

Returns:
all skeleton nodes on this skeleton path
Throws:
InvalidSkeletonException

getEndnode1

public SkeletonNode getEndnode1()
Get the skeleton path's first end node.

Returns:
the skeleton path's first end node

getEndnode2

public SkeletonNode getEndnode2()
Get the skeleton path's second end node.

Returns:
the skeleton path's second end node

getPathLength

public double getPathLength()
get this skeleton path's length, that is, the number of skeleton nodes on this path.

Returns:
length the path's length

getVectorRepresentation

public double[] getVectorRepresentation()
Get the skeleton path vector representation.

The matching algorithm uses this special representation for skeleton paths, including information about the object's contour.

See SkeletonPathGetter for more information.

Returns:
the path representation of this skeleton path

setAllNodes

public void setAllNodes(java.util.List<SkeletonNode> allNodes)
Set all nodes on this skeleton path.

Parameters:
allNodes - an ordered list of all nodes on this skeleton path to be set

setEndnode1

public void setEndnode1(SkeletonNode endnode1)
Set the skeleton path's first end node.

Parameters:
endnode1 - - the skeleton path's first end node

setEndnode2

public void setEndnode2(SkeletonNode endnode2)
Set the skeleton path's second end node.

Parameters:
endnode2 - the skeleton path's second end node

setVectorRepresentation

public void setVectorRepresentation(double[] vectorRepresentation)
Set the skeleton path vector representation.

The matching algorithm uses this special representation for skeleton paths, including information about the object's contour.

See SkeletonPathGetter for more information.

Parameters:
vectorRepresentation - the skeleton path representation to be set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(SkeletonPath arg0)
Specified by:
compareTo in interface java.lang.Comparable<SkeletonPath>