org.osm2world.core.map_data.data
Class MapSegment

Object
  extended by MapSegment
Direct Known Subclasses:
MapAreaSegment, MapWaySegment

public class MapSegment
extends Object


Field Summary
protected  MapNode endNode
           
protected  MapNode startNode
           
 
Constructor Summary
MapSegment(MapNode startNode, MapNode endNode)
           
 
Method Summary
 VectorXZ getCenter()
          returns the center of the line
 VectorXZ getDirection()
          returns a normalized vector indicating the line's horizontal direction
 MapNode getEndNode()
           
 LineSegmentXZ getLineSegment()
           
 MapNode getOtherNode(MapNode node)
           
 VectorXZ getRightNormal()
          returns a the result of applying VectorXZ.rightNormal() to vector returned by getDirection()
 List<MapNode> getStartEndNodes()
           
 MapNode getStartNode()
           
 boolean isConnectedTo(MapArea other)
          returns true if this MapSegment shares a node with a MapArea
 boolean isConnectedTo(MapSegment other)
          returns true if this MapSegment shares a node with another MapSegment
 boolean sharesBothNodes(MapSegment other)
          returns true if this MapSegment shares both nodes with another MapSegment
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startNode

protected final MapNode startNode

endNode

protected final MapNode endNode
Constructor Detail

MapSegment

public MapSegment(MapNode startNode,
                  MapNode endNode)
Method Detail

getStartNode

public MapNode getStartNode()

getEndNode

public MapNode getEndNode()

getOtherNode

public MapNode getOtherNode(MapNode node)

getStartEndNodes

public List<MapNode> getStartEndNodes()

getLineSegment

public LineSegmentXZ getLineSegment()

getDirection

public VectorXZ getDirection()
returns a normalized vector indicating the line's horizontal direction


getRightNormal

public VectorXZ getRightNormal()
returns a the result of applying VectorXZ.rightNormal() to vector returned by getDirection()


getCenter

public VectorXZ getCenter()
returns the center of the line


isConnectedTo

public boolean isConnectedTo(MapSegment other)
returns true if this MapSegment shares a node with another MapSegment


isConnectedTo

public boolean isConnectedTo(MapArea other)
returns true if this MapSegment shares a node with a MapArea


sharesBothNodes

public boolean sharesBothNodes(MapSegment other)
returns true if this MapSegment shares both nodes with another MapSegment