Package org.opentrafficsim.core.object
Class StaticObject
java.lang.Object
nl.tudelft.simulation.event.EventProducer
org.opentrafficsim.core.object.StaticObject
- All Implemented Interfaces:
java.io.Serializable,Locatable,EventProducerInterface,Identifiable,Drawable,ObjectInterface
public class StaticObject extends EventProducer implements ObjectInterface, java.io.Serializable, Identifiable, Drawable
A static object with a height that a GTU might have to avoid, or which can cause occlusion for perception. All objects are
potential event producers, which allows them to signal that their state has changed.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION -
Constructor Summary
Constructors Constructor Description StaticObject(java.lang.String id, OTSLine3D geometry)StaticObject(java.lang.String id, OTSLine3D geometry, Length height) -
Method Summary
Modifier and Type Method Description StaticObjectclone(Network newNetwork, SimulatorInterface.TimeDoubleUnit newSimulator, boolean animation)Clone the StaticObject for e.g., copying a network.javax.media.j3d.BoundsgetBounds()java.lang.StringgetFullId()OTSLine3DgetGeometry()LengthgetHeight()java.lang.StringgetId()DirectedPointgetLocation()java.lang.StringtoString()Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
addListener, addListener, addListener, addListener, removeListener
-
Constructor Details
-
StaticObject
- Parameters:
id- String; the idgeometry- OTSLine3D; the top-level 2D outline of the objectheight- Length; the height of the object
-
StaticObject
- Parameters:
id- String; the idgeometry- OTSLine3D; the top-level 2D outline of the object
-
-
Method Details
-
getGeometry
- Specified by:
getGeometryin interfaceObjectInterface- Returns:
- the outline geometry of the object.
-
getHeight
- Specified by:
getHeightin interfaceObjectInterface- Returns:
- the height of the object (can be Length.ZERO).
-
getId
public final java.lang.String getId()- Specified by:
getIdin interfaceIdentifiable
-
getFullId
public java.lang.String getFullId()- Specified by:
getFullIdin interfaceObjectInterface- Returns:
- the full id that makes the id unique in the network.
-
getLocation
- Specified by:
getLocationin interfaceLocatable
-
getBounds
public javax.media.j3d.Bounds getBounds() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
clone
public StaticObject clone(Network newNetwork, SimulatorInterface.TimeDoubleUnit newSimulator, boolean animation) throws NetworkExceptionClone the StaticObject for e.g., copying a network.- Parameters:
newNetwork- Network; the new network to which the clone belongsnewSimulator- SimulatorInterface.TimeDoubleUnit; the new simulator for this networkanimation- boolean; whether to (re)create animation or not- Returns:
- a clone of this object
- Throws:
NetworkException- in case the cloning fails
-