1 /** 2 * 3 */ 4 package org.opentrafficsim.water; 5 6 import java.io.Serializable; 7 8 import javax.vecmath.Point3d; 9 10 import org.opentrafficsim.core.geometry.OTSPoint3D; 11 12 import com.vividsolutions.jts.geom.Coordinate; 13 14 import nl.tudelft.simulation.dsol.animation.Locatable; 15 import nl.tudelft.simulation.language.d3.DirectedPoint; 16 17 /** 18 * A located object can report its location. 19 * <p> 20 * Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br> 21 * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>. 22 * </p> 23 * <p> 24 * Based on software from the IDVV project, which is Copyright (c) 2013 Rijkswaterstaat - Dienst Water, Verkeer en Leefomgeving 25 * and licensed without restrictions to Delft University of Technology, including the right to sub-license sources and derived 26 * products to third parties. 27 * </p> 28 * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, 29 * initial version Nov 6, 2016 <br> 30 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a> 31 */ 32 public interface Located extends Locatable, Serializable 33 { 34 /** @return the directed point */ 35 @Override 36 DirectedPoint getLocation(); 37 38 /** @return the GIS coordinate */ 39 default Coordinate getCoordinate() 40 { 41 return new Coordinate(getLocation().x, getLocation().y); 42 } 43 44 /** @return the coordinate for DSOL 2D or 3D */ 45 default Point3d getPoint3d() 46 { 47 return new Point3d(getLocation().x, getLocation().y, getLocation().z); 48 } 49 50 /** @return the coordinate for DSOL 2D or 3D */ 51 default OTSPoint3D getOTSPoint3D() 52 { 53 return new OTSPoint3D(getLocation()); 54 } 55 56 57 }