Class StaticObject

    • Constructor Detail

      • StaticObject

        protected StaticObject​(java.lang.String id,
                               OTSLine3D geometry,
                               Length height)
        Parameters:
        id - String; the id
        geometry - OTSLine3D; the top-level 2D outline of the object
        height - Length; the height of the object
    • Method Detail

      • init

        protected void init()
                     throws NetworkException
        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​(java.lang.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 id
        geometry - OTSLine3D; the top-level 2D outline of the object
        height - Length; the height of the object
        Returns:
        the static object
        Throws:
        NetworkException - e.g. on error registering the object in the network
      • create

        public static StaticObject create​(java.lang.String id,
                                          OTSLine3D geometry)
                                   throws NetworkException
        Make a static object with zero height and carry out the initialization after it has been fully created.
        Parameters:
        id - String; the id
        geometry - 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
      • getHeight

        public final Length getHeight()
        Specified by:
        getHeight in interface ObjectInterface
        Returns:
        the height of the object (can be Length.ZERO).
      • getId

        public final java.lang.String getId()
        Specified by:
        getId in interface Identifiable
      • getFullId

        public java.lang.String getFullId()
        Specified by:
        getFullId in interface ObjectInterface
        Returns:
        the full id that makes the id unique in the network.
      • getBounds

        public javax.media.j3d.Bounds getBounds()
        Specified by:
        getBounds in interface Locatable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clone

        public StaticObject clone​(Network newNetwork,
                                  boolean animation)
                           throws NetworkException
        Clone the StaticObject for e.g., copying a network.
        Parameters:
        newNetwork - Network; the new network to which the clone belongs
        animation - boolean; whether to (re)create animation or not
        Returns:
        a clone of this object
        Throws:
        NetworkException - in case the cloning fails