Class AbstractOctreeWrapper

java.lang.Object
gaiasky.scenegraph.SceneGraphNode
gaiasky.scenegraph.FadeNode
gaiasky.scenegraph.octreewrapper.AbstractOctreeWrapper
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IStarContainer, IPosition, java.lang.Iterable<OctreeNode>
Direct Known Subclasses:
OctreeWrapper

public abstract class AbstractOctreeWrapper
extends FadeNode
implements java.lang.Iterable<OctreeNode>
Abstract Octree wrapper with the common parts of the regular Octree wrapper and the concurrent one.
  • Field Details

    • root

      public OctreeNode root
    • roulette

      protected java.util.List<SceneGraphNode> roulette
      Roulette list with the objects to process
    • parenthood

      public java.util.Map<SceneGraphNode,​OctreeNode> parenthood
    • lastNumberObjects

      protected int lastNumberObjects
      The number of objects added to render in the last frame
    • copy

      protected boolean copy
      Is this just a copy?
  • Constructor Details

    • AbstractOctreeWrapper

      protected AbstractOctreeWrapper()
    • AbstractOctreeWrapper

      protected AbstractOctreeWrapper​(java.lang.String parentName, OctreeNode root)
  • Method Details

    • initialize

      public void initialize()
      An octree wrapper has as 'scene graph children' all the elements contained in the octree, even though it acts as a hub that decides which are processed and which are not.
      Overrides:
      initialize in class SceneGraphNode
    • containsObject

      public boolean containsObject​(SceneGraphNode object)
    • add

      public void add​(java.util.List<SceneGraphNode> children, OctreeNode octant)
    • add

      public void add​(SceneGraphNode child, OctreeNode octant)
    • removeParenthood

      public void removeParenthood​(SceneGraphNode child)
    • update

      public void update​(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera)
      Overrides:
      update in class SceneGraphNode
    • update

      public void update​(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera, float opacity)
      Overrides:
      update in class FadeNode
    • updateOctreeObjects

      protected abstract void updateOctreeObjects​(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera)
      Runs the update on all the observed and selected octree objects.
      Parameters:
      time -
      parentTransform -
      camera -
    • addToRenderLists

      public void addToRenderLists​(ICamera camera, OctreeNode octant)
    • iterator

      public java.util.Iterator<OctreeNode> iterator()
      Specified by:
      iterator in interface java.lang.Iterable<OctreeNode>
    • getStarCount

      public int getStarCount()
      Specified by:
      getStarCount in interface IStarContainer
      Overrides:
      getStarCount in class SceneGraphNode
    • highlight

      public void highlight​(boolean hl, float[] color)
      Description copied from class: FadeNode
      Highlight using a plain color
      Overrides:
      highlight in class FadeNode
      Parameters:
      hl - Whether to highlight
      color - The plain color
    • highlight

      public void highlight​(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax)
      Description copied from class: FadeNode
      Highlight using a colormap
      Overrides:
      highlight in class FadeNode
      Parameters:
      hl - Whether to highlight
      cmi - Color map index
      cma - Attribute
      cmmin - Min mapping value
      cmmax - Max mapping value
    • getSimpleCopy

      public <T extends SceneGraphNode> T getSimpleCopy()
      Gets a copy of this object but does not copy its parent or children
      Overrides:
      getSimpleCopy in class SceneGraphNode
      Returns:
      The copied object
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class SceneGraphNode