Class PointCloudData
java.lang.Object
gaiasky.data.util.PointCloudData
- All Implemented Interfaces:
Cloneable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA sample in the point cloud. -
Field Summary
FieldsModifier and TypeFieldDescriptiondoublePeriod, in days.The samples of this point cloud. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPoint(double x, double y, double z) voidaddPoint(double x, double y, double z, long seconds, int nano) voidvoidvoidvoidaddPoints(double[] points) Adds the given vector to the current points.voidclear()Clears all dataclone()getDate(int index) getEnd()longgetEndMs()intgetIndex(long wrappedTimeMs) intGets the bounding indices for the given date.intgetStart()longgetWrapTime(Instant instant) longgetWrapTimeMs(Instant instant) doublegetX(int index) doublegetY(int index) doublegetZ(int index) booleanhasTime()booleanisEmpty()voidLoads the data point at the index in the vector in the Orbit reference system.booleanReturns a vector with the data point at the given time.booleanReturns a vector with the data point at the given time.voidbooleanbooleanvoidloadPointF(com.badlogic.gdx.math.Vector3 v, int index) Loads the data point at the index in the vector in the world reference system.voidset(int index, double x, double y, double z) Sets the given index with the given coordinates.voidvoidsetX(int index, double x) Sets the x component of the point at the given index.voidsetY(int index, double y) Sets the y component of the point at the given index.voidsetZ(int index, double z) Sets the z component of the point at the given index.
-
Field Details
-
samples
The samples of this point cloud. -
period
public double periodPeriod, in days. Negative for no period.
-
-
Constructor Details
-
PointCloudData
public PointCloudData() -
PointCloudData
public PointCloudData(int capacity)
-
-
Method Details
-
set
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
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
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
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
public void clear()Clears all data -
isEmpty
public boolean isEmpty() -
hasTime
public boolean hasTime() -
addPoints
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
-
addPoint
-
addPoint
public void addPoint(double x, double y, double z, long seconds, int nano) -
addPoint
-
addPoint
public void addPoint(double x, double y, double z) -
loadPoint
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
-
getNumPoints
public int getNumPoints() -
getX
public double getX(int index) -
getY
public double getY(int index) -
getZ
public double getZ(int index) -
setPoint
-
getDate
-
getStart
-
getStartMs
public long getStartMs() -
getEnd
-
getEndMs
public long getEndMs() -
loadPointF
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
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
-
loadPoint
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 vectortimeMs- The time in milliseconds- Returns:
- Whether the operation completes successfully
-
loadPoint
-
getWrapTime
-
getWrapTimeMs
-
getIndex
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
public int getIndex(long wrappedTimeMs) -
clone
-