Package org.opentrafficsim.core.object
Class StaticObject
java.lang.Object
org.djutils.event.LocalEventProducer
org.opentrafficsim.core.object.StaticObject
- All Implemented Interfaces:
Serializable
,Remote
,Locatable
,org.djutils.event.EventProducer
,Identifiable
,Drawable
,LocatedObject
public class StaticObject
extends org.djutils.event.LocalEventProducer
implements LocatedObject, 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-2023 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:
-
Field Summary
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StaticObject
(String id, OtsLine3d geometry, Length height) -
Method Summary
Modifier and TypeMethodDescriptionstatic StaticObject
Make a static object with zero height and carry out the initialization after it has been fully created.static StaticObject
Make a static object and carry out the initialization after it has been fully created.final OtsLine3d
final Length
final String
getId()
protected void
init()
Initialize the object after it has been fully created.toString()
Methods inherited from class org.djutils.event.LocalEventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Constructor Details
-
StaticObject
- Parameters:
id
- String; the idgeometry
- OtsLine3d; the top-level 2D outline of the objectheight
- Length; the height of the object
-
-
Method Details
-
init
Initialize the object after it has been fully created.- Throws:
NetworkException
- e.g. on error registering the object in the network
-
create
public static StaticObject create(String id, OtsLine3d geometry, Length height) throws NetworkException Make a static object and carry out the initialization after it has been fully created.- Parameters:
id
- String; the idgeometry
- OtsLine3d; the top-level 2D outline of the objectheight
- Length; the height of the object- Returns:
- the static object
- Throws:
NetworkException
- e.g. on error registering the object in the network
-
create
Make a static object with zero height and carry out the initialization after it has been fully created.- Parameters:
id
- String; the idgeometry
- OtsLine3d; the top-level 2D outline of the object- Returns:
- the static object
- Throws:
NetworkException
- e.g. on error registering the object in the network
-
getGeometry
- Specified by:
getGeometry
in interfaceLocatedObject
- Returns:
- the outline geometry of the object.
-
getHeight
- Specified by:
getHeight
in interfaceLocatedObject
- Returns:
- the height of the object (can be Length.ZERO).
-
getId
- Specified by:
getId
in interfaceIdentifiable
-
getFullId
- Specified by:
getFullId
in interfaceLocatedObject
- Returns:
- the full id that makes the id unique in the network.
-
getLocation
- Specified by:
getLocation
in interfaceLocatable
-
getBounds
- Specified by:
getBounds
in interfaceLocatable
- Specified by:
getBounds
in interfaceLocatedObject
-
toString
-