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.CloneableObjects 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 voidaddPoint(Point3D point)Adds a new point to the point listvoidcenterPoints()Centers the points (around the origin)java.lang.Objectclone()Returns an identical PointList objectbooleanequals(java.lang.Object other)Returns true if the two point lists are identicalJama.MatrixgetAsMatrix()Returns point coordinates in a 3xN matrixPoint3DgetCentroid()Returns the centroid of pointsintgetNumberOfPoints()Returns the number of points in the listPoint3DgetPoint(int i)Returns the point of index ijava.util.ArrayList<Point3D>getPointsAsArrayList()Returns points in an ArrayListPointListgetSubList(java.util.ArrayList<java.lang.Integer> indices)Returns a subset of points defined by an ArrayList of indicesinthashCode()Returns hash codevoidloadFromMatrix(Jama.Matrix M)Loads point coordinates from a 3xN matrixvoidremovePoint(int i)Removes the point of index i from the point listvoidremovePoint(Point3D point)Removes the given point from the point listvoidrotate(Jama.Matrix rotationMatrix)Rotates the points by a given 3x3 rotation matrixvoidsetPoint(int i, Point3D point)Replaces the point of index i with a given pointvoidsetPointFromArrayList(java.util.ArrayList<Point3D> points)Loads points from an ArrayListjava.lang.StringtoString()Returns the String representation of point listjava.lang.StringtoStringInfo()Returns summary information about the point listvoidtranslate(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:
toStringin 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:
clonein 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:
equalsin classjava.lang.Object- Parameters:
other- the other point list
-
hashCode
public int hashCode()
Returns hash code- Overrides:
hashCodein classjava.lang.Object
-
-