org.osm2world.core.world.network
Class VisibleConnectorNodeWorldObject

Object
  extended by VisibleConnectorNodeWorldObject
All Implemented Interfaces:
IntersectionTestObject, NodeWorldObject, WorldObject, WorldObjectWithOutline
Direct Known Subclasses:
RoadModule.RoadConnector, RoadModule.RoadCrossingAtConnector

public abstract class VisibleConnectorNodeWorldObject
extends Object
implements NodeWorldObject, IntersectionTestObject, WorldObjectWithOutline


Field Summary
protected  VectorXZ cutVector
           
protected  VectorXZ endPos
           
protected  float endWidth
           
protected  boolean informationProvided
           
protected  MapNode node
           
protected  VectorXZ startPos
           
protected  float startWidth
           
 
Constructor Summary
VisibleConnectorNodeWorldObject(MapNode node)
           
 
Method Summary
 AxisAlignedBoundingBoxXZ getAxisAlignedBoundingBoxXZ()
           
abstract  float getLength()
          returns the length required by this node representation.
 List<VectorXYZ> getOutline(int from, int to)
          provides outline for the areas covered by the connector.
 PolygonXYZ getOutlinePolygon()
          returns a counterclockwise polygon defining the object's ground footprint.
 SimplePolygonXZ getOutlinePolygonXZ()
          returns a counterclockwise polygon defining the object's ground footprint, projected onto the XZ plane.
 List<VectorXZ> getOutlineXZ(int from, int to)
          variant of getOutline(int, int) for the XZ plane
 MapElement getPrimaryMapElement()
          returns the "primary" MapElement for this WorldObject; i.e.
 void setInformation(VectorXZ cutVector, VectorXZ startPos, VectorXZ endPos, float startWidth, float endWidth)
          sets the results of NetworkCalculator's calculations.
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface WorldObject
getClearingAbove, getClearingBelow, getGroundState
 

Field Detail

node

protected final MapNode node

informationProvided

protected boolean informationProvided

cutVector

protected VectorXZ cutVector

startPos

protected VectorXZ startPos

endPos

protected VectorXZ endPos

startWidth

protected float startWidth

endWidth

protected float endWidth
Constructor Detail

VisibleConnectorNodeWorldObject

public VisibleConnectorNodeWorldObject(MapNode node)
Method Detail

getLength

public abstract float getLength()
returns the length required by this node representation. Adjacent lines will be pushed back accordingly. If this is 0, this has the same effect as an invisible connector node (adjacent line representations directly touching each other). Examples where non-zero values are needed include crossings at nodes in roads. Needs to be provided by the implementing class before the calculation in NetworkCalculator starts.


setInformation

public void setInformation(VectorXZ cutVector,
                           VectorXZ startPos,
                           VectorXZ endPos,
                           float startWidth,
                           float endWidth)
sets the results of NetworkCalculator's calculations. Most methods in this class cannot be used until this method has provided the required information!


getPrimaryMapElement

public MapElement getPrimaryMapElement()
Description copied from interface: WorldObject
returns the "primary" MapElement for this WorldObject; i.e. the one it is most strongly associated with. Can be null if there is no (clear) primary element for this feature.

Specified by:
getPrimaryMapElement in interface WorldObject

getOutlineXZ

public List<VectorXZ> getOutlineXZ(int from,
                                   int to)
variant of getOutline(int, int) for the XZ plane


getOutline

public List<VectorXYZ> getOutline(int from,
                                  int to)
provides outline for the areas covered by the connector. The from and to indices refer to the list returned by the underlying MapNode's MapNode.getConnectedSegments() method. TODO: method necessary after Terrain change?


getOutlinePolygonXZ

public SimplePolygonXZ getOutlinePolygonXZ()
Description copied from interface: WorldObjectWithOutline
returns a counterclockwise polygon defining the object's ground footprint, projected onto the XZ plane.

Specified by:
getOutlinePolygonXZ in interface WorldObjectWithOutline
Returns:
outline polygon; null if this world object doesn't cover any area

getOutlinePolygon

public PolygonXYZ getOutlinePolygon()
Description copied from interface: WorldObjectWithOutline
returns a counterclockwise polygon defining the object's ground footprint.

Specified by:
getOutlinePolygon in interface WorldObjectWithOutline
Returns:
outline polygon; null if this world object doesn't cover any area

getAxisAlignedBoundingBoxXZ

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

toString

public String toString()
Overrides:
toString in class Object