Package gov.nasa.worldwind.ogc.kml.impl
Class KMLTraversalContext
- java.lang.Object
-
- gov.nasa.worldwind.ogc.kml.impl.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
TheDeque
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, ornull
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 specifiedregion
to the top of this KML traversal context's Region stack.void
setDetailHint(double detailHint)
Specifies this KML traversal context's detail hint.
-
-
-
Field Detail
-
regionStack
protected java.util.Deque<KMLRegion> regionStack
TheDeque
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.
-
-
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 specifiedregion
to the top of this KML traversal context's Region stack. The specified region is returned by any subsequent calls topeekRegion
until eitherpushRegion
orpopRegion
are called. Theregion
is removed from the stack by callingpopRegion
.- Parameters:
region
- the KML Region to add to the top of the stack.- Throws:
java.lang.IllegalArgumentException
- ifregion
isnull
.
-
peekRegion
public KMLRegion peekRegion()
Returns the KML Region on the top of this KML traversal context's Region stack, ornull
if the Region stack is empty. The Region on the top of the stack the last region added with a call topushRegion
. 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 topushRegion
.- Returns:
- the Region removed from the top of the stack.
- Throws:
java.util.NoSuchElementException
- if the Region stack is empty.
-
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)
-
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.
-
-