org.osm2world.core.map_data.data
Class MapNode

Object
  extended by MapNode
All Implemented Interfaces:
MapElement, IntersectionTestObject

public class MapNode
extends Object
implements MapElement

grid representation of an OSM node, references inbound and outbound MapWaySegments. For each OSM node, one GridNode will be created.


Constructor Summary
MapNode(VectorXZ pos, OSMNode osmNode)
           
 
Method Summary
 void addAdjacentArea(MapArea adjacentArea)
           
 void addInboundLine(MapWaySegment inboundLine)
           
 void addOutboundLine(MapWaySegment outboundLine)
           
 void addRepresentation(NodeWorldObject representation)
          adds a visual representation for this node
 void calculateAdjacentAreaSegments()
          needs to be called after adding and completing all adjacent areas
 Collection<MapArea> getAdjacentAreas()
           
 AxisAlignedBoundingBoxXZ getAxisAlignedBoundingBoxXZ()
           
 List<MapSegment> getConnectedSegments()
          returns all way segments and area segments connected with this node.
 List<MapWaySegment> getConnectedWaySegments()
          returns all way segments connected with this node.
 NodeElevationProfile getElevationProfile()
          returns the elevation information for this GridElement.
 List<MapWaySegment> getInboundLines()
          returns those connected lines that end here.
 int getLayer()
           
 OSMNode getOsmNode()
           
 List<MapWaySegment> getOutboundLines()
          returns those connected lines that start here.
 Collection<MapOverlap<?,?>> getOverlaps()
          returns all overlaps between this MapElement and other MapElements.
 VectorXZ getPos()
           
 NodeWorldObject getPrimaryRepresentation()
          returns the primary representation, or null if the object doesn't have any.
 List<NodeWorldObject> getRepresentations()
          returns the visual representations of this element.
 TagGroup getTags()
          returns the tags of the underlying OSMElement
 void setElevationProfile(NodeElevationProfile elevationProfile)
           
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapNode

public MapNode(VectorXZ pos,
               OSMNode osmNode)
Method Detail

getPos

public VectorXZ getPos()

getLayer

public int getLayer()
Specified by:
getLayer in interface MapElement

getOsmNode

public OSMNode getOsmNode()

getTags

public TagGroup getTags()
Description copied from interface: MapElement
returns the tags of the underlying OSMElement

Specified by:
getTags in interface MapElement

getAdjacentAreas

public Collection<MapArea> getAdjacentAreas()

addInboundLine

public void addInboundLine(MapWaySegment inboundLine)

addOutboundLine

public void addOutboundLine(MapWaySegment outboundLine)

getInboundLines

public List<MapWaySegment> getInboundLines()
returns those connected lines that end here. Sorting is as for getConnectedWaySegments().


getOutboundLines

public List<MapWaySegment> getOutboundLines()
returns those connected lines that start here. Sorting is as for getConnectedWaySegments().


addAdjacentArea

public void addAdjacentArea(MapArea adjacentArea)

calculateAdjacentAreaSegments

public void calculateAdjacentAreaSegments()
needs to be called after adding and completing all adjacent areas


getConnectedWaySegments

public List<MapWaySegment> getConnectedWaySegments()
returns all way segments connected with this node. They will be sorted according to the clockwise (seen from above) angle between the vector "this node -> other node of the segment" and the positive x direction.


getConnectedSegments

public List<MapSegment> getConnectedSegments()
returns all way segments and area segments connected with this node. Sorted like getConnectedWaySegments().


getRepresentations

public List<NodeWorldObject> getRepresentations()
Description copied from interface: MapElement
returns the visual representations of this element. The order should match the order in which they were added, so that dependencies are preserved (elements that depend on another element should be placed after that element). The first element is considered the "primary" representation, and for some purposes - such as elevation calculation -, only this representation will be used.

Specified by:
getRepresentations in interface MapElement

getPrimaryRepresentation

public NodeWorldObject getPrimaryRepresentation()
Description copied from interface: MapElement
returns the primary representation, or null if the object doesn't have any.

Specified by:
getPrimaryRepresentation in interface MapElement
See Also:
MapElement.getRepresentations()

addRepresentation

public void addRepresentation(NodeWorldObject representation)
adds a visual representation for this node


getElevationProfile

public NodeElevationProfile getElevationProfile()
Description copied from interface: MapElement
returns the elevation information for this GridElement. Can be null if no elevations have been set yet or if the element was ignored during elevation calculation because it didn't have a representation.

Specified by:
getElevationProfile in interface MapElement

setElevationProfile

public void setElevationProfile(NodeElevationProfile elevationProfile)

toString

public String toString()
Overrides:
toString in class Object

getOverlaps

public Collection<MapOverlap<?,?>> getOverlaps()
Description copied from interface: MapElement
returns all overlaps between this MapElement and other MapElements.

Specified by:
getOverlaps in interface MapElement

getAxisAlignedBoundingBoxXZ

public AxisAlignedBoundingBoxXZ getAxisAlignedBoundingBoxXZ()
Specified by:
getAxisAlignedBoundingBoxXZ in interface IntersectionTestObject