Class StaticObject

    • Constructor Detail

      • StaticObject

        protected StaticObject​(String id,
                               Polygon3d geometry,
                               Length minimumRelativeHeight,
                               Length maximumRelativeHeight)
                        throws NullPointerException,
                               IllegalArgumentException
        Construct a new StaticObject.
        Parameters:
        id - String; the id of the new StaticObject
        geometry - Polygon3d; the top-view 3D outline of the object relative to its location
        minimumRelativeHeight - Length; the minimum height of the object, relative to the z-value of its location
        maximumRelativeHeight - Length; the maximum height of the object, relative to the z-value of its location
        Throws:
        NullPointerException - when id, geometry, minimumRelativeHeight, or maximumRelativeHeight is null
        IllegalArgumentException - when minimumRelativeHeight exceeds maximumRelativeHeight
    • 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​(String id,
                                          Polygon3d geometry,
                                          Length minimumRelativeHeight,
                                          Length maximumRelativeHeight)
                                   throws NetworkException
        Make a static object and carry out the initialization after it has been fully created.
        Parameters:
        id - String; the id of the new StaticObject
        geometry - Polygon3d; the top-level 3D outline of the object
        minimumRelativeHeight - Length; the minimum height of the object, relative to the z-value of its location
        maximumRelativeHeight - Length; the maximum height of the object, relative to the z-value of its location
        Returns:
        StaticObject; the new StaticObject
        Throws:
        NetworkException - e.g. on error registering the object in the network
      • create

        public static StaticObject create​(String id,
                                          Polygon3d geometry)
                                   throws NetworkException
        Create a new StaticObject with zero minimumRelativeHeight and zero maximumRelativeHeight and carry out the initialization after it has been fully created.
        Parameters:
        id - String; the id of the new StaticObject
        geometry - Polygon3d; the top-view 3D outline of the object
        Returns:
        StaticObject; the new StaticObject
        Throws:
        NetworkException - e.g. on error registering the object in the network
      • getGeometry

        public final Polygon3d getGeometry()
        Retrieve the outline geometry of the object.
        Specified by:
        getGeometry in interface ObjectInterface
        Returns:
        PolyLine3d; the outline geometry of the object
      • getMinimumRelativeHeight

        public final Length getMinimumRelativeHeight()
        Get the minimum elevation relative to the Z of getLocation.
        Specified by:
        getMinimumRelativeHeight in interface ObjectInterface
        Returns:
        Length; the minimum elevation relative to the Z of getLocation
      • getMaximumRelativeHeight

        public final Length getMaximumRelativeHeight()
        Get the maximum elevation relative to the Z of getLocation.
        Specified by:
        getMaximumRelativeHeight in interface ObjectInterface
        Returns:
        Length; the maximum elevation relative to the Z of getLocation
      • getFullId

        public String getFullId()
        Retrieve the full id that (must be unique within the network).
        Specified by:
        getFullId in interface ObjectInterface
        Returns:
        String; the full id that makes the id unique in the network
      • clone

        public StaticObject clone​(Network newNetwork,
                                  boolean animation)
                           throws NetworkException
        Clone this 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:
        StaticObject; a clone of this StaticObject
        Throws:
        NetworkException - in case the cloning fails