Package jgromacs.data

Class PointList

java.lang.Object
jgromacs.data.PointList
All Implemented Interfaces:
Cloneable

public class PointList extends Object implements Cloneable
Objects of this class represent a list of 3D points
  • Constructor Details

    • PointList

      public PointList()
      Constructs a new PointList object
  • Method Details

    • getPointsAsArrayList

      public ArrayList<Point3D> getPointsAsArrayList()
      Returns points in an ArrayList
      Returns:
      Points in an ArrayList
    • setPointFromArrayList

      public void setPointFromArrayList(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 - index
      point - 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(ArrayList<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 String toString()
      Returns the String representation of point list
      Overrides:
      toString in class Object
      Returns:
      String representation
    • toStringInfo

      public String toStringInfo()
      Returns summary information about the point list
      Returns:
      summary information
    • clone

      public Object clone()
      Returns an identical PointList object
      Overrides:
      clone in class Object
      Returns:
      clone of the point list
    • equals

      public boolean equals(Object other)
      Returns true if the two point lists are identical
      Overrides:
      equals in class Object
      Parameters:
      other - the other point list
    • hashCode

      public int hashCode()
      Returns hash code
      Overrides:
      hashCode in class Object