NASA World Wind

gov.nasa.worldwind
Class BasicModel

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.BasicModel
All Implemented Interfaces:
AVList, MessageListener, Model, WWObject, PropertyChangeListener, EventListener

public class BasicModel
extends WWObjectImpl
implements Model

This class aggregates the objects making up a model: the globe and layers. Through the globe it also indirectly includes the elevation model and the surface geometry tessellator. A default model is defined in worldwind.xml or its application-specified alternate.


Constructor Summary
BasicModel()
           
BasicModel(Globe globe, LayerList layers)
           
 
Method Summary
protected  LayerList createLayersFromElement(Element element)
          Create the layer list from an XML configuration element.
 Extent getExtent()
          Returns the bounding sphere in Cartesian world coordinates of the model.
 Globe getGlobe()
          Indicates the globe in this model.
 LayerList getLayers()
          Indicates the layers associated with this model.
 boolean isShowTessellationBoundingVolumes()
          Indicates whether the bounding volumes of the tessellated globe's surface geometry should be displayed.
 boolean isShowWireframeExterior()
          Indicates whether the globe surface's exterior geometry is to be drawn.
 boolean isShowWireframeInterior()
          Indicates whether the globe surface's interior geometry is to be drawn.
 void onMessage(Message msg)
          Empty implementation of MessageListener.
 void setGlobe(Globe globe)
          Specifies the model's globe.
 void setLayers(LayerList layers)
          Specifies the model's layers.
 void setShowTessellationBoundingVolumes(boolean showTessellationBoundingVolumes)
          Specifies whether the bounding volumes of the globes tessellated surface geometry is to be drawn.
 void setShowWireframeExterior(boolean show)
          Specifies whether to display as wireframe the exterior geometry of the tessellated globe surface.
 void setShowWireframeInterior(boolean show)
          Specifies whether to display as wireframe the interior geometry of the tessellated globe surface.
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
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, toString, 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
 

Constructor Detail

BasicModel

public BasicModel()

BasicModel

public BasicModel(Globe globe,
                  LayerList layers)
Method Detail

createLayersFromElement

protected LayerList createLayersFromElement(Element element)
Create the layer list from an XML configuration element.

Parameters:
element - the configuration description.
Returns:
a new layer list matching the specified description.

getExtent

public Extent getExtent()
Returns the bounding sphere in Cartesian world coordinates of the model.

Specified by:
getExtent in interface Model
Returns:
the model's bounding sphere in Cartesian coordinates, or null if the extent cannot be determined.

getGlobe

public Globe getGlobe()
Indicates the globe in this model.

Specified by:
getGlobe in interface Model
Returns:
The globe associated with this model.

getLayers

public LayerList getLayers()
Indicates the layers associated with this model.

Specified by:
getLayers in interface Model
Returns:
List of layers in this model.

isShowTessellationBoundingVolumes

public boolean isShowTessellationBoundingVolumes()
Indicates whether the bounding volumes of the tessellated globe's surface geometry should be displayed.

Specified by:
isShowTessellationBoundingVolumes in interface Model
Returns:
true if the bounding volumes are to be drawn, otherwise false.

isShowWireframeExterior

public boolean isShowWireframeExterior()
Indicates whether the globe surface's exterior geometry is to be drawn.

Specified by:
isShowWireframeExterior in interface Model
Returns:
true if it is to be drawn, otherwise false.

isShowWireframeInterior

public boolean isShowWireframeInterior()
Indicates whether the globe surface's interior geometry is to be drawn.

Specified by:
isShowWireframeInterior in interface Model
Returns:
true if it is to be drawn, otherwise false.

onMessage

public void onMessage(Message msg)
Empty implementation of MessageListener.

This implementation forwards the message each layer in the model.

Specified by:
onMessage in interface MessageListener
Overrides:
onMessage in class WWObjectImpl
Parameters:
msg - The message that was received.

setGlobe

public void setGlobe(Globe globe)
Specifies the model's globe.

Specified by:
setGlobe in interface Model
Parameters:
globe - the model's new globe. May be null, in which case the current globe will be detached from the model.

setLayers

public void setLayers(LayerList layers)
Specifies the model's layers.

Specified by:
setLayers in interface Model
Parameters:
layers - the model's new layers. May be null, in which case the current layers will be detached from the model.

setShowTessellationBoundingVolumes

public void setShowTessellationBoundingVolumes(boolean showTessellationBoundingVolumes)
Specifies whether the bounding volumes of the globes tessellated surface geometry is to be drawn.

Specified by:
setShowTessellationBoundingVolumes in interface Model
Parameters:
showTessellationBoundingVolumes - true if the bounding volumes should be drawn, false, the default, if not.

setShowWireframeExterior

public void setShowWireframeExterior(boolean show)
Specifies whether to display as wireframe the exterior geometry of the tessellated globe surface.

Specified by:
setShowWireframeExterior in interface Model
Parameters:
show - true causes the geometry to be shown, false, the default, does not.

setShowWireframeInterior

public void setShowWireframeInterior(boolean show)
Specifies whether to display as wireframe the interior geometry of the tessellated globe surface.

Specified by:
setShowWireframeInterior in interface Model
Parameters:
show - true causes the geometry to be shown, false, the default, does not.

NASA World Wind