java.lang.Object
de.grogra.pointcloud.clustering.PointCloudOctree
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPointCloudOctree
(int layer) A constructor to get an octree object.PointCloudOctree
(PointCloudBaseImpl pc, List<ClusterPoint> points, int depth) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPoint
(ClusterPoint point) Adds a point to this octree.double
Returns the center x position of this octree.double
Returns the center y position of this octree.double
Returns the center z position of this octree.getChild
(int octant) Returns the octree child on the given octant (0 - 7).int
getLayer()
Returns the layer of this octree (in relation to the root octree).double
Returns the maximum x value of this octree.double
Returns the maximum y value of this octree.double
Returns the maximum z value of this octree.double
Returns the minimum x value of this octree.double
Returns the minimum y value of this octree.double
Returns the minimum z value of this octree.getNeighbors
(ClusterPoint point, double distance) Returns the neighbor points for the given point.int
Returns the number of non-null child elements.Returns the list of points of this octreevoid
movePointsToLayer
(int layer) Moves the points of this octree to the respective octree or octrees on the given layer.void
setChild
(int octant, PointCloudOctree child) Sets one of the eight children (one of the eight octants).void
setLayer
(int layer) Sets the layer of this octree (in relation to the root octree).void
setMaximumX
(double maximum) Sets the maximum x value of this octree.void
setMaximumY
(double maximum) Sets the maximum y value of this octree.void
setMaximumZ
(double maximum) Sets the maximum z value of this octree.void
setMinimumX
(double minimum) Sets the minimum x value of this octree.void
setMinimumY
(double minimum) Sets the minimum y value of this octree.void
setMinimumZ
(double minimum) Sets the minimum z value of this octree.void
setPoints
(List<ClusterPoint> points) Sets the points of this octree.
-
Field Details
-
OCTREE_CHILDREN
public static final int OCTREE_CHILDREN- See Also:
-
-
Constructor Details
-
PointCloudOctree
public PointCloudOctree(int layer) A constructor to get an octree object. The layer is defined as specified in the parameter. The points are declared as an empty list. The children array is initialized.- Parameters:
layer
- The layer of this octree
-
PointCloudOctree
-
-
Method Details
-
setChild
Sets one of the eight children (one of the eight octants). The octant parameter must be in the range of 0 to 7.- Parameters:
octant
- The octant number (0 - 7)child
- The child octree that should be added
-
getChild
Returns the octree child on the given octant (0 - 7). If the octant was never declared or set to null, the returned object will also be null.- Parameters:
octant
- The number of the wanted octant (0 - 7)- Returns:
- The octant child element or null
-
getNumberOfChildren
public int getNumberOfChildren()Returns the number of non-null child elements. Because the octree has always eight places to store child elements, only the used children are counted.- Returns:
- The number of used child elements
-
movePointsToLayer
public void movePointsToLayer(int layer) Moves the points of this octree to the respective octree or octrees on the given layer. If the layer is lower than the layer of this octree, the points are collected and moved to the given parent node. If the layer is higher than the layer of this octree node, the points are distributed to the fitting child elements.- Parameters:
layer
- The target layer (where to move the points to)
-
getNeighbors
Returns the neighbor points for the given point. An other point is a neighbor point if the distance between both points is less than the given distance. If there are no neighbor points, an empty list is returned.- Parameters:
point
- The point to get the neighbor points fordistance
- The maximum distance to identify other points as neighbor points- Returns:
- The list of neighbor points or an empty list in case of no neighbor points
-
setLayer
public void setLayer(int layer) Sets the layer of this octree (in relation to the root octree).- Parameters:
layer
- The new layer for this octree
-
getLayer
public int getLayer()Returns the layer of this octree (in relation to the root octree).- Returns:
- The layer of this octree
-
setPoints
Sets the points of this octree.- Parameters:
points
- The new poionts for this octree
-
addPoint
Adds a point to this octree.- Parameters:
point
- The point to add
-
getPoints
Returns the list of points of this octree- Returns:
- The list of points of this octree
-
getCenterX
public double getCenterX()Returns the center x position of this octree. The center x position is the middle between the minimum x position and the maximum x position.- Returns:
- The center x position
-
getCenterY
public double getCenterY()Returns the center y position of this octree. The center y position is the middle between the minimum y position and the maximum y position.- Returns:
- The center y position
-
getCenterZ
public double getCenterZ()Returns the center z position of this octree. The center z position is the middle between the minimum z position and the maximum z position.- Returns:
- The center z position
-
setMinimumX
public void setMinimumX(double minimum) Sets the minimum x value of this octree.- Parameters:
minimum
- The new minimum x value for this octree
-
getMinimumX
public double getMinimumX()Returns the minimum x value of this octree.- Returns:
- The minimum x value of this octree
-
setMinimumY
public void setMinimumY(double minimum) Sets the minimum y value of this octree.- Parameters:
minimum
- The new minimum y value for this octree
-
getMinimumY
public double getMinimumY()Returns the minimum y value of this octree.- Returns:
- The minimum y value of this octree
-
setMinimumZ
public void setMinimumZ(double minimum) Sets the minimum z value of this octree.- Parameters:
minimum
- The new minimum z value for this octree
-
getMinimumZ
public double getMinimumZ()Returns the minimum z value of this octree.- Returns:
- The minimum z value of this octree
-
setMaximumX
public void setMaximumX(double maximum) Sets the maximum x value of this octree.- Parameters:
maximum
- The new maximum x value for this octree
-
getMaximumX
public double getMaximumX()Returns the maximum x value of this octree.- Returns:
- The maximum x value of this octree
-
setMaximumY
public void setMaximumY(double maximum) Sets the maximum y value of this octree.- Parameters:
maximum
- The new maximum y value for this octree
-
getMaximumY
public double getMaximumY()Returns the maximum y value of this octree.- Returns:
- The maximum y value of this octree
-
setMaximumZ
public void setMaximumZ(double maximum) Sets the maximum z value of this octree.- Parameters:
maximum
- The new maximum z value for this octree
-
getMaximumZ
public double getMaximumZ()Returns the maximum z value of this octree.- Returns:
- The maximum z value of this octree
-