View Javadoc
1   package nl.tudelft.simulation.dsol.animation;
2   
3   import java.awt.geom.Point2D;
4   
5   import org.djutils.draw.bounds.Bounds3d;
6   import org.djutils.draw.point.OrientedPoint3d;
7   
8   /**
9    * A StaticLocation in 3 dimensions.
10   * <p>
11   * Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
12   * for project information <a href="https://simulation.tudelft.nl/" target="_blank"> https://simulation.tudelft.nl</a>. The DSOL
13   * project is distributed under a three-clause BSD-style license, which can be found at
14   * <a href="https://https://simulation.tudelft.nl/dsol/docs/latest/license.html" target="_blank">
15   * https://https://simulation.tudelft.nl/dsol/docs/latest/license.html</a>.
16   * </p>
17   * @author <a href="https://www.linkedin.com/in/peterhmjacobs">Peter Jacobs </a>
18   */
19  public class StaticLocation3d extends OrientedPoint3d implements Locatable
20  {
21      /** The default serial version UID for serializable classes. */
22      private static final long serialVersionUID = 1L;
23  
24      /** the bounds. */
25      private Bounds3d bounds = null;
26  
27      /**
28       * constructs a new StaticLocation.
29       * @param x double; the x location
30       * @param y double; the y location
31       * @param z double; the z location
32       * @param rotX double; rotation around x-axis (theta)
33       * @param rotY double; rotation around y-axis (phi)
34       * @param rotZ double; rotation around z-axis (rho)
35       * @param bounds Bounds3d; the bounds
36       */
37      public StaticLocation3d(final double x, final double y, final double z, final double rotX, final double rotY,
38              final double rotZ, final Bounds3d bounds)
39      {
40          super(x, y, z, rotX, rotY, rotZ);
41          this.bounds = bounds;
42      }
43  
44      /**
45       * constructs a new StaticLocation.
46       * @param point2D Point2D; the point2d
47       * @param rotZ double; the rotation in the xy plane
48       * @param bounds Bounds; the bounds
49       */
50      public StaticLocation3d(final Point2D point2D, final double rotZ, final Bounds3d bounds)
51      {
52          super(point2D.getX(), point2D.getY(), 0.0, 0.0, 0.0, rotZ);
53          this.bounds = bounds;
54      }
55  
56      /**
57       * constructs a new StaticLocation.
58       * @param location OrientedPoint3d; the location
59       * @param bounds Bounds; the bounds
60       */
61      public StaticLocation3d(final OrientedPoint3d location, final Bounds3d bounds)
62      {
63          super(location.getX(), location.getY(), location.getZ(), location.getDirX(), location.getDirY(), location.getDirZ());
64          this.bounds = bounds;
65      }
66  
67      /** {@inheritDoc} */
68      @Override
69      public OrientedPoint3d getLocation()
70      {
71          return this;
72      }
73  
74      /** {@inheritDoc} */
75      @Override
76      public Bounds3d getBounds()
77      {
78          return this.bounds;
79      }
80  
81  }