Class PointCloudData

java.lang.Object
gaiasky.data.util.PointCloudData
All Implemented Interfaces:
Cloneable

public class PointCloudData extends Object implements Cloneable
Holds data for point clouds.
  • Field Details Link icon

  • Constructor Details Link icon

    • PointCloudData Link icon

      public PointCloudData()
    • PointCloudData Link icon

      public PointCloudData(int capacity)
  • Method Details Link icon

    • set Link icon

      public void set(int index, double x, double y, double z)
      Sets the given index with the given coordinates.
      Parameters:
      index - The index.
      x - The x coordinate.
      y - The y coordinate.
      z - The z coordinate.
    • setX Link icon

      public void setX(int index, double x)
      Sets the x component of the point at the given index.

      This method is given for backwards compatibility with old scripts.

      Parameters:
      index - The index.
      x - The x component.
    • setY Link icon

      public void setY(int index, double y)
      Sets the y component of the point at the given index.

      This method is given for backwards compatibility with old scripts.

      Parameters:
      index - The index.
      y - The y component.
    • setZ Link icon

      public void setZ(int index, double z)
      Sets the z component of the point at the given index.

      This method is given for backwards compatibility with old scripts.

      Parameters:
      index - The index.
      z - The z component.
    • clear Link icon

      public void clear()
      Clears all data
    • isEmpty Link icon

      public boolean isEmpty()
    • hasTime Link icon

      public boolean hasTime()
    • addPoints Link icon

      public void addPoints(double[] points)
      Adds the given vector to the current points. The vector is of the form [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn]. If the size of the vector is not a multiple of 3, no points are added
      Parameters:
      points - The points to add to this point cloud
    • addPoint Link icon

      public void addPoint(Vector3D point, Instant t)
    • addPoint Link icon

      public void addPoint(Vector3D point)
    • addPoint Link icon

      public void addPoint(double x, double y, double z, long seconds, int nano)
    • addPoint Link icon

      public void addPoint(double x, double y, double z, Instant t)
    • addPoint Link icon

      public void addPoint(double x, double y, double z)
    • loadPoint Link icon

      public void loadPoint(Vector3D v, int index)
      Loads the data point at the index in the vector in the Orbit reference system.
      Parameters:
      v - The vector to load the data into.
      index - The data index.
    • loadPoint Link icon

      public void loadPoint(Vector3Q v, int index)
    • getNumPoints Link icon

      public int getNumPoints()
    • getX Link icon

      public double getX(int index)
    • getY Link icon

      public double getY(int index)
    • getZ Link icon

      public double getZ(int index)
    • setPoint Link icon

      public void setPoint(Vector3D v, int index)
    • getDate Link icon

      public Instant getDate(int index)
    • getStart Link icon

      public Instant getStart()
    • getStartMs Link icon

      public long getStartMs()
    • getEnd Link icon

      public Instant getEnd()
    • getEndMs Link icon

      public long getEndMs()
    • loadPointF Link icon

      public void loadPointF(com.badlogic.gdx.math.Vector3 v, int index)
      Loads the data point at the index in the vector in the world reference system.
      Parameters:
      v - The vector to store the result.
      index - The index of the point to load.
    • loadPoint Link icon

      public boolean loadPoint(Vector3D v, Instant instant)
      Returns a vector with the data point at the given time. It uses linear interpolation. The time instant must be within the bounds of this point cloud's times
      Parameters:
      v - The vector to store the result.
      instant - The time as an instant.
      Returns:
      Whether the operation completes successfully
    • loadPoint Link icon

      public boolean loadPoint(Vector3Q v, Instant instant)
    • loadPoint Link icon

      public boolean loadPoint(Vector3D v, long timeMs)
      Returns a vector with the data point at the given time. It uses linear interpolation. The time instant must be within the bounds of this point cloud's times
      Parameters:
      v - The vector
      timeMs - The time in milliseconds
      Returns:
      Whether the operation completes successfully
    • loadPoint Link icon

      public boolean loadPoint(Vector3Q v, long timeMs)
    • getWrapTime Link icon

      public Instant getWrapTime(Instant instant)
    • getWrapTimeMs Link icon

      public long getWrapTimeMs(Instant instant)
    • getIndex Link icon

      public int getIndex(Instant instant)
      Gets the bounding indices for the given date. If the date is out of range, it wraps.
      Parameters:
      instant - The date
      Returns:
      The two indices
    • getIndex Link icon

      public int getIndex(long wrappedTimeMs)
    • clone Link icon

      public PointCloudData clone()
      Overrides:
      clone in class Object