org.osm2world.core.world.data
Class AbstractAreaWorldObject

Object
  extended by AbstractAreaWorldObject
All Implemented Interfaces:
IntersectionTestObject, AreaWorldObject, WorldObject, WorldObjectWithOutline
Direct Known Subclasses:
NetworkAreaWorldObject

public abstract class AbstractAreaWorldObject
extends Object
implements WorldObjectWithOutline, AreaWorldObject, IntersectionTestObject

implementation of AreaWorldObject that offers some basic features: < ul>

  • providing the object outline based on the MapArea
  • providing bounding geometry for intersection tests
  • calculating a triangulation of the surface for rendering


    Field Summary
    protected  MapArea area
               
     
    Constructor Summary
    protected AbstractAreaWorldObject(MapArea area)
               
     
    Method Summary
     AxisAlignedBoundingBoxXZ getAxisAlignedBoundingBoxXZ()
               
     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.
     MapElement getPrimaryMapElement()
              returns the "primary" MapElement for this WorldObject; i.e.
    protected  Collection<TriangleXYZ> getTriangulation()
              decompose this area into counterclockwise triangles
     
    Methods inherited from class Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface WorldObject
    getClearingAbove, getClearingBelow, getGroundState
     

    Field Detail

    area

    protected final MapArea area
    Constructor Detail

    AbstractAreaWorldObject

    protected AbstractAreaWorldObject(MapArea area)
    Method Detail

    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

    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

    getTriangulation

    protected Collection<TriangleXYZ> getTriangulation()
    decompose this area into counterclockwise triangles