Package jgromacs.data
Class PointList
java.lang.Object
jgromacs.data.PointList
- All Implemented Interfaces:
Cloneable
Objects of this class represent a list of 3D points
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new point to the point listvoid
Centers the points (around the origin)clone()
Returns an identical PointList objectboolean
Returns true if the two point lists are identicalJama.Matrix
Returns point coordinates in a 3xN matrixReturns the centroid of pointsint
Returns the number of points in the listgetPoint
(int i) Returns the point of index iReturns points in an ArrayListgetSubList
(ArrayList<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
Replaces the point of index i with a given pointvoid
setPointFromArrayList
(ArrayList<Point3D> points) Loads points from an ArrayListtoString()
Returns the String representation of point listReturns summary information about the point listvoid
Translates the points by a given vector
-
Constructor Details
-
PointList
public PointList()Constructs a new PointList object
-
-
Method Details
-
getPointsAsArrayList
Returns points in an ArrayList- Returns:
- Points in an ArrayList
-
setPointFromArrayList
Loads points from an ArrayList- Parameters:
points
- ArrayList of points
-
addPoint
Adds a new point to the point list- Parameters:
point
- new point
-
getPoint
Returns the point of index i- Parameters:
i
- index- Returns:
- Point of index i
-
setPoint
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
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
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
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
Translates the points by a given vector- Parameters:
vector
- translation vector
-
toString
Returns the String representation of point list -
toStringInfo
Returns summary information about the point list- Returns:
- summary information
-
clone
Returns an identical PointList object -
equals
Returns true if the two point lists are identical -
hashCode
public int hashCode()Returns hash code
-