Module pointcloud

Class Octree

java.lang.Object
de.grogra.pointcloud.tools.Octree

public class Octree extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Octree(int layer)
    A constructor to get an octree object.
    Octree(BoundedCloud pc, int depth)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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).
    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(Cloud.Point point, double distance)
    Returns the neighbor points for the given point.
    int
    Returns the number of non-null child elements.
    void
    movePointsToLayer(int layer)
    Moves the points of this octree to the respective octree or octrees on the given layer.
    void
    setChild(int octant, Octree child)
    Sets one of the eight children (one of the eight octants).
    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
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Octree

      public Octree(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
    • Octree

      public Octree(BoundedCloud pc, int depth)
  • Method Details

    • setPoints

      public void setPoints(List<Cloud.Point> points)
    • setChild

      public void setChild(int octant, Octree child)
      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

      public Octree getChild(int octant)
      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

      public List<Cloud.Point> getNeighbors(Cloud.Point point, double distance)
      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 for
      distance - 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
    • 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