|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.layers.AbstractLayer
gov.nasa.worldwind.layers.CachedRenderableLayer
public class CachedRenderableLayer
Holds a collection of Renderables and manages local caching of them. Provides searching for Renderables by sector, location or name.
NOTE: This class is experimental and not fully implemented. You should not use it now.
| Field Summary | |
|---|---|
protected static int |
DEFAULT_DEPTH
|
protected BasicQuadTree<Renderable> |
extentTree
|
protected PickSupport |
pickSupport
|
| Constructor Summary | |
|---|---|
CachedRenderableLayer(Sector coverage)
Constructs a layer instance. |
|
CachedRenderableLayer(Sector coverage,
int numLevels)
Constructs a layer instance. |
|
| Method Summary | |
|---|---|
void |
add(Renderable item)
Add a Renderable to the layer. |
void |
add(Renderable item,
String name)
Adds a named Renderable to the layer. |
void |
dispose()
Disposes any Renderables implementing @{link Dispose} and removes all Renderables from the layer. |
protected void |
disposeRenderables()
|
protected void |
doPick(DrawContext dc,
Iterable<? extends Renderable> renderables,
Point pickPoint)
|
protected void |
doPick(DrawContext dc,
Point pickPoint)
|
protected void |
doPreRender(DrawContext dc)
|
protected void |
doPreRender(DrawContext dc,
Iterable<? extends Renderable> renderables)
|
protected void |
doRender(DrawContext dc)
|
protected void |
doRender(DrawContext dc,
Iterable<? extends Renderable> renderables)
|
Iterable<? extends Renderable> |
getAllRenderables()
Returns all Renderables in the layer. |
Renderable |
getByName(String name)
Searches the layer for a named Renderable. |
double |
getOpacity()
Returns the layer's opacity value, which is ignored by this layer because each of its renderables typiically has its own opacity control. |
Collection<? extends Renderable> |
getRenderables(LatLon location)
Returns all Renderables at a specfied location. |
Collection<? extends Renderable> |
getRenderables(Sector extent)
Returns all Renderables within or intersecting a specified sector. |
boolean |
hasItems()
Indictes whether the layer contains Renderables. |
void |
remove(Renderable item)
Remove a Renderable from the layer if the Renderable is in the layer. |
void |
removeByName(String name)
Remove a named Renderable from the layer if it is in the layer. |
void |
setOpacity(double opacity)
Opacity is not applied to layers of this type because each renderable typically has its own opacity control. |
String |
toString()
|
| Methods inherited from class gov.nasa.worldwind.WWObjectImpl |
|---|
onMessage, propertyChange |
| Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface gov.nasa.worldwind.avlist.AVList |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from interface java.beans.PropertyChangeListener |
|---|
propertyChange |
| Methods inherited from interface gov.nasa.worldwind.event.MessageListener |
|---|
onMessage |
| Field Detail |
|---|
protected static final int DEFAULT_DEPTH
protected BasicQuadTree<Renderable> extentTree
protected PickSupport pickSupport
| Constructor Detail |
|---|
public CachedRenderableLayer(Sector coverage)
coverage - the geographic area covered by the layer's Renderables.
IllegalArgumentException - if the coverage sector is null.
public CachedRenderableLayer(Sector coverage,
int numLevels)
coverage - the geographic area covered by the layer's Renderables.numLevels - the depth of the tree used to sort the Renderables.
IllegalArgumentException - if the coverage sector is null or the number of levels is less than 1;| Method Detail |
|---|
public void add(Renderable item)
item - the Renderable to add.
IllegalArgumentException - if the item is null or does not implement GeographicExtent.add(gov.nasa.worldwind.render.Renderable, String)
public void add(Renderable item,
String name)
item - the Renderable to add.name - a name for the Renderable. May be null, in which case the item has no name.
IllegalArgumentException - if the item is null or does not implement GeographicExtent.add(gov.nasa.worldwind.render.Renderable)public void dispose()
dispose in interface Disposabledispose in class AbstractLayerprotected void disposeRenderables()
protected void doPick(DrawContext dc,
Iterable<? extends Renderable> renderables,
Point pickPoint)
protected void doPick(DrawContext dc,
Point pickPoint)
doPick in class AbstractLayerprotected void doPreRender(DrawContext dc)
doPreRender in class AbstractLayer
protected void doPreRender(DrawContext dc,
Iterable<? extends Renderable> renderables)
protected void doRender(DrawContext dc)
doRender in class AbstractLayer
protected void doRender(DrawContext dc,
Iterable<? extends Renderable> renderables)
public Iterable<? extends Renderable> getAllRenderables()
public Renderable getByName(String name)
name - the name to search for. If null, no search is performed and null is returned.
public double getOpacity()
getOpacity in interface LayergetOpacity in class AbstractLayerpublic Collection<? extends Renderable> getRenderables(LatLon location)
location - the location of interest.
getRenderables(gov.nasa.worldwind.geom.Sector),
getAllRenderables()public Collection<? extends Renderable> getRenderables(Sector extent)
extent - the location of interest.
getRenderables(gov.nasa.worldwind.geom.LatLon),
getAllRenderables()public boolean hasItems()
public void remove(Renderable item)
item - the Renderable to removeremoveByName(String)public void removeByName(String name)
name - the name of the Renderable to remove. If null, no Renderable is removed.remove(gov.nasa.worldwind.render.Renderable)public void setOpacity(double opacity)
setOpacity in interface LayersetOpacity in class AbstractLayeropacity - the current opacity value, which is ignored by this layer.public String toString()
toString in class AbstractLayer
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||