Class OctreeImpl

java.lang.Object
cz.fidentis.analyst.data.octree.impl.OctreeImpl
All Implemented Interfaces:
Octree, Serializable

public class OctreeImpl extends Object implements Octree
OctTree implementation.
See Also:
  • Constructor Details

    • OctreeImpl

      public OctreeImpl(Collection<MeshFacet> facets)
      Constructor. If no mesh points (vertices) are provided, then an empty Octree is constructed (with the root node set to null). If multiple mesh facets share the same vertex, then they are stored efficiently in the same node of the Octree.
      Parameters:
      facets - The list of mesh facets to be stored. Facets can share vertices.
  • Method Details

    • getRoot

      public OctNode getRoot()
      Description copied from interface: Octree
      Tree traversal - go to the "root" of the tree.
      Specified by:
      getRoot in interface Octree
      Returns:
      root node of the tree
    • getMinLen

      public Double getMinLen()
      Specified by:
      getMinLen in interface Octree
      Returns:
      distance of the smallest cell in Octree.
    • accept

      public void accept(OctreeVisitor visitor)
      Description copied from interface: Octree
      Visits this tree.
      Specified by:
      accept in interface Octree
      Parameters:
      visitor - Visitor
    • toString

      public String toString()
      Recursively display the contents of the tree in a verbose format. Individual nodes are represented in format [small boundary, large boundary] point and ends with skipped n empty node(-s) where n is the number of empty leaf child nodes in the node float numbers have 2 decimal places
      Overrides:
      toString in class Object
      Returns:
      representation of the tree
    • toString

      protected String toString(boolean printEmpty)
      Recursively display the contents of the tree in a verbose format. Individual nodes are represented in format (if the node does not hold a point and printEmpty is true) [small boundary, large boundary] and in format if it does [small boundary, large boundary] point and if printEmpty is set to false the node ends with skipped n empty node(-s) where n is the number of empty leaf child nodes in the node float numbers have 2 decimal places
      Parameters:
      printEmpty - if empty nodes should be printed or just skipped
      Returns:
      representation of the tree
    • toString

      protected String toString(boolean printEmpty, int decimalPlaces)
      Recursively display the contents of the tree in a verbose format. Individual nodes are represented in format (if the node does not hold a point and printEmpty is true) [small boundary, large boundary] and in format if it does [small boundary, large boundary] point and if printEmpty is set to false the node ends with skipped n empty node(-s) where n is the number of empty leaf child nodes in the node float numbers have decimalPlaces decimal places
      Parameters:
      printEmpty - if empty nodes should be printed or just skipped
      decimalPlaces - number of decimal places for float numbers
      Returns:
      representation of the tree
    • updateMinLen

      protected void updateMinLen(javax.vecmath.Point3d smallestPoint, javax.vecmath.Point3d largestPoint)
      Updates minLen class property to match the minimum length of octNode
      Parameters:
      smallestPoint - of octNode
      largestPoint - of octNode