package org.opentrafficsim.demo.ntm.shapeobjects;
import java.awt.geom.Path2D;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Set;
import javax.media.j3d.Bounds;
import org.locationtech.jts.geom.Geometry;
import nl.tudelft.simulation.dsol.animation.Locatable;
import nl.tudelft.simulation.language.d3.DirectedPoint;
/**
*
* Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License.
*
* $LastChangedDate$, @version $Revision$, by $Author$,
* initial version 13 Nov 2014
* @author Alexander Verbraeck
* @author Hans van Lint
* @author Peter Knoppers
* @author Guus Tamminga
* @author Yufei Yuan
*/
public class ShapeObject implements Locatable
{
/** */
private Geometry geometry;
/** */
private ArrayList values;
/** The lines for the animation, relative to the centroid. */
private Set lines = null;
/**
* @param theGeom
* @param values ArrayList<String>;
*/
public ShapeObject(Geometry geometry, ArrayList values)
{
this.geometry = geometry;
this.values = values;
}
/* *//**
* @return polygon
* @throws RemoteException
*/
/*
* public Set getLines() throws RemoteException { // create the polygon if it did not exist before if (this.lines ==
* null) { double dx = this.getLocation().getX(); double dy = this.getLocation().getY(); // double dx = 0; // double dy = 0;
* this.lines = new LinkedHashSet(); for (int i = 0; i < this.getDesignLine().getLineString().getNumGeometries(); i++) {
* Path2D line = new Path2D.Double(); Geometry g = this.getDesignLine().getLineString().getDesignLineN(i); boolean start =
* true; for (Coordinate c : g.getCoordinates()) { if (start) { line.moveTo(c.x - dx, dy - c.y); start = false; } else {
* line.lineTo(c.x - dx, dy - c.y); } } this.lines.add(line); } } return this.lines; }
*/
/**
* @return theGeom.
*/
public Geometry getDesignLine()
{
return this.geometry;
}
/**
* @param theGeom set theGeom.
*/
public void setGeometry(Geometry geometry)
{
this.geometry = geometry;
}
/**
* @return table.
*/
public ArrayList getValues()
{
return this.values;
}
/**
* @param table set table.
*/
public void setValues(ArrayList values)
{
this.values = values;
}
/** {@inheritDoc} */
@Override
public DirectedPoint getLocation() throws RemoteException
{
return null;
}
/** {@inheritDoc} */
@Override
public Bounds getBounds() throws RemoteException
{
return null;
}
}