Package jgromacs.data
Class PointList
- java.lang.Object
-
- jgromacs.data.PointList
-
- All Implemented Interfaces:
java.lang.Cloneable
public class PointList extends java.lang.Object implements java.lang.Cloneable
Objects of this class represent a list of 3D points
-
-
Constructor Summary
Constructors Constructor Description PointList()
Constructs a new PointList object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPoint(Point3D point)
Adds a new point to the point listvoid
centerPoints()
Centers the points (around the origin)java.lang.Object
clone()
Returns an identical PointList objectboolean
equals(java.lang.Object other)
Returns true if the two point lists are identicalJama.Matrix
getAsMatrix()
Returns point coordinates in a 3xN matrixPoint3D
getCentroid()
Returns the centroid of pointsint
getNumberOfPoints()
Returns the number of points in the listPoint3D
getPoint(int i)
Returns the point of index ijava.util.ArrayList<Point3D>
getPointsAsArrayList()
Returns points in an ArrayListPointList
getSubList(java.util.ArrayList<java.lang.Integer> indices)
Returns a subset of points defined by an ArrayList of indicesint
hashCode()
Returns hash codevoid
loadFromMatrix(Jama.Matrix M)
Loads point coordinates from a 3xN matrixvoid
removePoint(int i)
Removes the point of index i from the point listvoid
removePoint(Point3D point)
Removes the given point from the point listvoid
rotate(Jama.Matrix rotationMatrix)
Rotates the points by a given 3x3 rotation matrixvoid
setPoint(int i, Point3D point)
Replaces the point of index i with a given pointvoid
setPointFromArrayList(java.util.ArrayList<Point3D> points)
Loads points from an ArrayListjava.lang.String
toString()
Returns the String representation of point listjava.lang.String
toStringInfo()
Returns summary information about the point listvoid
translate(Point3D vector)
Translates the points by a given vector
-
-
-
Method Detail
-
getPointsAsArrayList
public java.util.ArrayList<Point3D> getPointsAsArrayList()
Returns points in an ArrayList- Returns:
- Points in an ArrayList
-
setPointFromArrayList
public void setPointFromArrayList(java.util.ArrayList<Point3D> points)
Loads points from an ArrayList- Parameters:
points
- ArrayList of points
-
addPoint
public void addPoint(Point3D point)
Adds a new point to the point list- Parameters:
point
- new point
-
getPoint
public Point3D getPoint(int i)
Returns the point of index i- Parameters:
i
- index- Returns:
- Point of index i
-
setPoint
public void setPoint(int i, Point3D point)
Replaces the point of index i with a given point- Parameters:
i
- indexpoint
- new point
-
removePoint
public void removePoint(int i)
Removes the point of index i from the point list- Parameters:
i
- index
-
removePoint
public void removePoint(Point3D point)
Removes the given point from the point list- Parameters:
point
- point to remove
-
getNumberOfPoints
public int getNumberOfPoints()
Returns the number of points in the list- Returns:
- Number of points
-
getSubList
public PointList getSubList(java.util.ArrayList<java.lang.Integer> indices)
Returns a subset of points defined by an ArrayList of indices- Parameters:
indices
- ArrayList of indices- Returns:
- subset of points
-
getAsMatrix
public Jama.Matrix getAsMatrix()
Returns point coordinates in a 3xN matrix- Returns:
- coordinate matrix
-
loadFromMatrix
public void loadFromMatrix(Jama.Matrix M)
Loads point coordinates from a 3xN matrix- Parameters:
M
- coordinate matrix
-
centerPoints
public void centerPoints()
Centers the points (around the origin)
-
getCentroid
public Point3D getCentroid()
Returns the centroid of points- Returns:
- centroid point
-
rotate
public void rotate(Jama.Matrix rotationMatrix)
Rotates the points by a given 3x3 rotation matrix- Parameters:
rotationMatrix
- rotation matrix
-
translate
public void translate(Point3D vector)
Translates the points by a given vector- Parameters:
vector
- translation vector
-
toString
public java.lang.String toString()
Returns the String representation of point list- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation
-
toStringInfo
public java.lang.String toStringInfo()
Returns summary information about the point list- Returns:
- summary information
-
clone
public java.lang.Object clone()
Returns an identical PointList object- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of the point list
-
equals
public boolean equals(java.lang.Object other)
Returns true if the two point lists are identical- Overrides:
equals
in classjava.lang.Object
- Parameters:
other
- the other point list
-
hashCode
public int hashCode()
Returns hash code- Overrides:
hashCode
in classjava.lang.Object
-
-