Class KMLTraversalContext


  • public class KMLTraversalContext
    extends java.lang.Object
    KMLTraversalContext provides a suitcase of KML specific state used to render a hierarchy of KML features.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double detailHint
      Indicates this KML traversal context's detail hint.
      protected java.util.Deque<KMLRegion> regionStack
      The Deque as this KML traversal context's Region stack.
    • Constructor Summary

      Constructors 
      Constructor Description
      KMLTraversalContext()
      Constructs a new KML traversal context in a default state, but otherwise does nothing.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getDetailHint()
      Indicates this KML traversal context's detail hint, which is described in setDetailHint(double).
      void initialize()
      Initializes this KML traversal context to its default state.
      KMLRegion peekRegion()
      Returns the KML Region on the top of this KML traversal context's Region stack, or null if the Region stack is empty.
      KMLRegion popRegion()
      Removes the KML Region from the top of this KML traversal context's Region stack.
      void pushRegion​(KMLRegion region)
      Adds the specified region to the top of this KML traversal context's Region stack.
      void setDetailHint​(double detailHint)
      Specifies this KML traversal context's detail hint.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • regionStack

        protected java.util.Deque<KMLRegion> regionStack
        The Deque as this KML traversal context's Region stack. The region stack is used to implement Regions inheritance of from a KML containers to their descendant KML features.
      • detailHint

        protected double detailHint
        Indicates this KML traversal context's detail hint. Modifies the default relationship of KML scene resolution to screen resolution as viewing distance changes. Values greater than 0 increase the resolution. Values less than 0 decrease the resolution. Initially 0.
    • Constructor Detail

      • KMLTraversalContext

        public KMLTraversalContext()
        Constructs a new KML traversal context in a default state, but otherwise does nothing.
    • Method Detail

      • initialize

        public void initialize()
        Initializes this KML traversal context to its default state. This should be called at the beginning of each frame to prepare this traversal context for the coming render pass.
      • pushRegion

        public void pushRegion​(KMLRegion region)
        Adds the specified region to the top of this KML traversal context's Region stack. The specified region is returned by any subsequent calls to peekRegion until either pushRegion or popRegion are called. The region is removed from the stack by calling popRegion.
        Parameters:
        region - the KML Region to add to the top of the stack.
        Throws:
        java.lang.IllegalArgumentException - if region is null.
      • peekRegion

        public KMLRegion peekRegion()
        Returns the KML Region on the top of this KML traversal context's Region stack, or null if the Region stack is empty. The Region on the top of the stack the last region added with a call to pushRegion. This does not modify the contents of the stack.
        Returns:
        the Region on the top of this context's stack, or null if the stack is empty.
      • popRegion

        public KMLRegion popRegion()
        Removes the KML Region from the top of this KML traversal context's Region stack. This throws an exception if the Region stack is empty, otherwise this removes and returns the last Region added to the stack by a call to pushRegion.
        Returns:
        the Region removed from the top of the stack.
        Throws:
        java.util.NoSuchElementException - if the Region stack is empty.
      • setDetailHint

        public void setDetailHint​(double detailHint)
        Specifies this KML traversal context's detail hint. The detail hint modifies the default relationship of KML scene resolution to screen resolution as the viewing distance changes. Values greater than 0 cause KML elements with a level of detail to appear at higher resolution at greater distances than normal, but at an increased performance cost. Values less than 0 decrease the default resolution at any given distance. The default value is 0. Values typically range between -0.5 and 0.5.
        Parameters:
        detailHint - the degree to modify the default relationship of KML scene resolution to screen resolution as viewing distance changes. Values greater than 0 increase the resolution. Values less than 0 decrease the resolution. The default value is 0.