NASA World Wind

gov.nasa.worldwind.ogc.kml.impl
Class KMLTraversalContext

java.lang.Object
  extended by gov.nasa.worldwind.ogc.kml.impl.KMLTraversalContext

public class KMLTraversalContext
extends Object

KMLTraversalContext provides a suitcase of KML specific state used to render a hierarchy of KML features.


Field Summary
protected  double detailHint
          Indicates this KML traversal context's detail hint.
protected  Deque<KMLRegion> regionStack
          The Deque as this KML traversal context's Region stack.
 
Constructor Summary
KMLTraversalContext()
          Constructs a new KML traversal context in a default state, but otherwise does nothing.
 
Method Summary
 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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.


regionStack

protected 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.

Constructor Detail

KMLTraversalContext

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

Method Detail

getDetailHint

public double getDetailHint()
Indicates this KML traversal context's detail hint, which is described in setDetailHint(double).

Returns:
the detail hint.
See Also:
setDetailHint(double)

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.


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:
NoSuchElementException - if the Region stack is empty.

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:
IllegalArgumentException - if region is null.

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.

NASA World Wind