Class ClusterPoint

java.lang.Object
de.grogra.pointcloud.clustering.ClusterPoint

public class ClusterPoint extends Object
  • Constructor Details

    • ClusterPoint

      public ClusterPoint(double x, double y, double z)
      A constructor to get a point with three coordinates. The point cloud is set to null.
      Parameters:
      x - The x coordinate of the point
      y - The y coordinate of the point
      z - The z coordinate of the point
    • ClusterPoint

      public ClusterPoint(ClusterPoint point)
      A constructor to clone a point. The point cloud reference is also copied.
      Parameters:
      point - The point to clone
    • ClusterPoint

      public ClusterPoint(LeafPointImpl leaf)
  • Method Details

    • getDistanceToPoint

      public double getDistanceToPoint(ClusterPoint point)
      Returns the distance between this point and the given point. The distance is calculated with the pythagorean theorem.
      Parameters:
      point - The other point
      Returns:
      The distance between this point and the given point
    • getDistanceToLine

      public double getDistanceToLine(ClusterVector position, ClusterVector direction)
      Returns the distance between this point and the given line (represented by a position vector and a direction vector).
      Parameters:
      position - The position vector of the line
      direction - The direction vector of the line
      Returns:
      The distance between this point and that line
    • getDistanceToPlane

      public double getDistanceToPlane(ClusterVector position, ClusterVector normal)
      Returns the distance between this point and the given plane (represented by a position vector and a normal vector).
      Parameters:
      position - The position vector of the plane
      normal - The normal vector of the plane
      Returns:
      The distance between this point and that plane
    • getSignedDistanceToPlane

      public double getSignedDistanceToPlane(ClusterVector position, ClusterVector normal)
      Returns the signed distance between this point and the given plane (represented by a position vector and a normal vector). Signed means that the distance is negative if the point is below the plane and the distance is positive if the point is above the plane.
      Parameters:
      position - The position vector of the plane
      normal - The normal vector of the plane
      Returns:
      The signed distance between this point and that plane
    • setX

      public void setX(double x)
      Sets the x coordinate of this point.
      Parameters:
      x - The new x coordinate for this point
    • getX

      public double getX()
      Returns the x coordinate of this point.
      Returns:
      The x coordinate of this point
    • setY

      public void setY(double y)
      Sets the y coordinate of this point.
      Parameters:
      y - The new y coordinate for this point
    • getY

      public double getY()
      Returns the y coordinate of this point.
      Returns:
      The y coordinate of this point
    • setZ

      public void setZ(double z)
      Sets the z coordinate of this point.
      Parameters:
      z - The new z coordinate for this point
    • getZ

      public double getZ()
      Returns the z coordinate of this point.
      Returns:
      The z coordinate of this point
    • setPointCloud

      public void setPointCloud(PointCloudBaseImpl pointCloud)
      Sets the point cloud reference of this point.
      Parameters:
      id - The new point cloud reference for this point
    • getPointCloud

      public PointCloudBaseImpl getPointCloud()
      Returns the point cloud reference of this point.
      Returns:
      The point cloud reference of this point
    • getLeaf

      public LeafPointImpl getLeaf()
    • setLeaf

      public void setLeaf(LeafPointImpl leaf)
    • toVector

      public ClusterVector toVector()
      Converts this point to a vector and returns the vector. The point cloud information is not stored in the vector. The vector has always one dimension with three elements.
      Returns:
      The vector with the x, y, and z value of this point
    • addCoordinates

      public void addCoordinates(ClusterPoint point)
      Adds the position of the given other point to the position of this point.
      Parameters:
      point - An other point