org.osm2world.core.world.network
public abstract class AbstractNetworkWaySegmentWorldObject extends Object implements NetworkWaySegmentWorldObject, WaySegmentWorldObject, IntersectionTestObject, WorldObjectWithOutline
Modifier and Type | Field and Description |
---|---|
protected EleConnectorGroup |
connectors |
MapWaySegment |
segment |
Modifier | Constructor and Description |
---|---|
protected |
AbstractNetworkWaySegmentWorldObject(MapWaySegment segment) |
Modifier and Type | Method and Description |
---|---|
void |
defineEleConstraints(EleConstraintEnforcer enforcer)
lets this object add constraints for the relative elevations of its
EleConnector s. |
AxisAlignedBoundingBoxXZ |
getAxisAlignedBoundingBoxXZ() |
List<VectorXYZ> |
getCenterline()
3d version of
getCenterlineXZ() . |
protected List<EleConnector> |
getCenterlineEleConnectors() |
List<VectorXZ> |
getCenterlineXZ()
returns a sequence of node running along the center of the
line from start to end (each with offset).
|
VectorXZ |
getCutVectorAt(MapNode node) |
EleConnectorGroup |
getEleConnectors()
returns all
EleConnector s used by this WorldObject |
VectorXZ |
getEndCutVector()
returns the cut vector for the end of the line.
|
VectorXZ |
getEndOffset()
returns the current offset for the end of the line.
|
VectorXZ |
getEndPosition()
returns the end position.
|
protected VectorXZ |
getEndWithOffset() |
GroundState |
getGroundState()
implementation of
WorldObject.getGroundState() . |
List<VectorXYZ> |
getOutline(boolean right)
provides the left or right border (a line at an appropriate distance
from the center line), taking into account cut vectors, offsets and
elevation information.
|
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(boolean right)
Variant of
getOutline(boolean) . |
VectorXYZ |
getPointOnCut(boolean start,
double relativePosFromLeft)
returns a point on the start or end cut line.
|
MapWaySegment |
getPrimaryMapElement()
returns the "primary"
MapElement for this WorldObject;
i.e. |
VectorXZ |
getStartCutVector()
returns the cut vector for the start of the line.
|
VectorXZ |
getStartOffset()
returns the current offset for the end of the line.
|
VectorXZ |
getStartPosition()
returns the start position.
|
protected VectorXZ |
getStartWithOffset() |
boolean |
isBroken()
checks whether this segment has a broken outline.
|
void |
setEndCutVector(VectorXZ cutVector)
Sets the cut vector for the end of the line.
|
void |
setEndOffset(VectorXZ offsetVector)
Sets the offset for the end of the line.
|
void |
setStartCutVector(VectorXZ cutVector)
Sets the cut vector for the start of the line.
|
void |
setStartOffset(VectorXZ offsetVector)
Sets the offset for the start of the line.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getWidth
public final MapWaySegment segment
protected EleConnectorGroup connectors
protected AbstractNetworkWaySegmentWorldObject(MapWaySegment segment)
public final MapWaySegment getPrimaryMapElement()
WorldObject
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.getPrimaryMapElement
in interface WaySegmentWorldObject
getPrimaryMapElement
in interface WorldObject
public void setStartCutVector(VectorXZ cutVector)
NetworkWaySegmentWorldObject
NetworkCalculator
.setStartCutVector
in interface NetworkWaySegmentWorldObject
public void setEndCutVector(VectorXZ cutVector)
NetworkWaySegmentWorldObject
NetworkCalculator
.setEndCutVector
in interface NetworkWaySegmentWorldObject
public VectorXZ getStartCutVector()
NetworkWaySegmentWorldObject
NetworkWaySegmentWorldObject.setStartCutVector(VectorXZ)
.getStartCutVector
in interface NetworkWaySegmentWorldObject
public VectorXZ getEndCutVector()
NetworkWaySegmentWorldObject
NetworkWaySegmentWorldObject.setStartCutVector(VectorXZ)
.getEndCutVector
in interface NetworkWaySegmentWorldObject
public void setStartOffset(VectorXZ offsetVector)
NetworkWaySegmentWorldObject
NetworkCalculator
.setStartOffset
in interface NetworkWaySegmentWorldObject
public void setEndOffset(VectorXZ offsetVector)
NetworkWaySegmentWorldObject
NetworkCalculator
.setEndOffset
in interface NetworkWaySegmentWorldObject
protected VectorXZ getStartWithOffset()
protected VectorXZ getEndWithOffset()
public GroundState getGroundState()
WorldObject.getGroundState()
.
This version checks for bridge and tunnel tags to make the decision.
If that is not desired, subclasses may override the method.getGroundState
in interface WorldObject
public EleConnectorGroup getEleConnectors()
WorldObject
EleConnector
s used by this WorldObjectgetEleConnectors
in interface WorldObject
public void defineEleConstraints(EleConstraintEnforcer enforcer)
WorldObject
EleConnector
s. Called after WorldObject.getEleConnectors()
.defineEleConstraints
in interface WorldObject
protected List<EleConnector> getCenterlineEleConnectors()
public List<VectorXZ> getCenterlineXZ()
WaySegmentElevationProfile
for adding
elevation information.public List<VectorXYZ> getCenterline()
getCenterlineXZ()
.
Only available after elevation calculation.public List<VectorXZ> getOutlineXZ(boolean right)
getOutline(boolean)
.
This one is already available before elevation calculation.public List<VectorXYZ> getOutline(boolean right)
WaySegmentElevationProfile.getPointsWithEle()
.
//TODO: compatible with future offset/clearing influences?public SimplePolygonXZ getOutlinePolygonXZ()
WorldObjectWithOutline
getOutlinePolygonXZ
in interface WorldObjectWithOutline
public PolygonXYZ getOutlinePolygon()
WorldObjectWithOutline
getOutlinePolygon
in interface WorldObjectWithOutline
public boolean isBroken()
public VectorXYZ getPointOnCut(boolean start, double relativePosFromLeft)
start
- point is on the start cut if true, on the end cut if falserelativePosFromLeft
- 0 is the leftmost point, 1 the rightmost.
Values in between are for interpolation.public VectorXZ getStartOffset()
NetworkWaySegmentWorldObject
NetworkWaySegmentWorldObject.setEndOffset(VectorXZ)
call, returning (0,0).getStartOffset
in interface NetworkWaySegmentWorldObject
public VectorXZ getEndOffset()
NetworkWaySegmentWorldObject
NetworkWaySegmentWorldObject.setEndOffset(VectorXZ)
call, returning (0,0).getEndOffset
in interface NetworkWaySegmentWorldObject
public VectorXZ getStartPosition()
WaySegmentWorldObject
MapWaySegment
's start position;
as node features such as crossings require space, too.getStartPosition
in interface WaySegmentWorldObject
public VectorXZ getEndPosition()
WaySegmentWorldObject
WaySegmentWorldObject.getStartPosition()
for details.getEndPosition
in interface WaySegmentWorldObject
public AxisAlignedBoundingBoxXZ getAxisAlignedBoundingBoxXZ()
getAxisAlignedBoundingBoxXZ
in interface IntersectionTestObject
public String toString()
toString
in class Object