java.lang.Object
de.grogra.pointcloud.clustering.ClusterPoint
-
Constructor Summary
ConstructorDescriptionClusterPoint
(double x, double y, double z) A constructor to get a point with three coordinates.ClusterPoint
(ClusterPoint point) A constructor to clone a point.ClusterPoint
(LeafPointImpl leaf) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCoordinates
(ClusterPoint point) Adds the position of the given other point to the position of this point.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).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).double
getDistanceToPoint
(ClusterPoint point) Returns the distance between this point and the given point.getLeaf()
Returns the point cloud reference of this point.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).double
getX()
Returns the x coordinate of this point.double
getY()
Returns the y coordinate of this point.double
getZ()
Returns the z coordinate of this point.void
setLeaf
(LeafPointImpl leaf) void
setPointCloud
(PointCloudBaseImpl pointCloud) Sets the point cloud reference of this point.void
setX
(double x) Sets the x coordinate of this point.void
setY
(double y) Sets the y coordinate of this point.void
setZ
(double z) Sets the z coordinate of this point.toVector()
Converts this point to a vector and returns the vector.
-
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 pointy
- The y coordinate of the pointz
- The z coordinate of the point
-
ClusterPoint
A constructor to clone a point. The point cloud reference is also copied.- Parameters:
point
- The point to clone
-
ClusterPoint
-
-
Method Details
-
getDistanceToPoint
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
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 linedirection
- The direction vector of the line- Returns:
- The distance between this point and that line
-
getDistanceToPlane
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 planenormal
- The normal vector of the plane- Returns:
- The distance between this point and that plane
-
getSignedDistanceToPlane
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 planenormal
- 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
Sets the point cloud reference of this point.- Parameters:
id
- The new point cloud reference for this point
-
getPointCloud
Returns the point cloud reference of this point.- Returns:
- The point cloud reference of this point
-
getLeaf
-
setLeaf
-
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
Adds the position of the given other point to the position of this point.- Parameters:
point
- An other point
-