org.xith3d.scenegraph
Interface LazyLoadable

All Known Implementing Classes:
ChunkedTerrain, L3DTerrain

public interface LazyLoadable

A LazyLoadable is a class that is able to be constructed and teared down asynchronously on demand. This interface is typically implemented by Nodes passed to a LODSwitch.


Method Summary
 void cleanUp()
          This method will be called by the engine on a dedicated thread (not the rendering thread) to allow the background destruction of a Node.
 boolean isSetUp()
          Returns whether this instance is already set up, so it can be used right away.
 void prepare()
          This method will be called by the engine on a dedicated thread (not the rendering thread) to allow the background construction of a Node.
 void setUp()
          This method will be called by the engine on the rendering thread to to allow thread safe attachment of the constructed content to the scenegraph.
 void tearDown()
          This method will be called by the engine on the rendering thread to to allow thread safe detachment of the content from the scenegraph.
 

Method Detail

isSetUp

boolean isSetUp()
Returns whether this instance is already set up, so it can be used right away.

Returns:
true, if the instance is fully set up, false otherwise

prepare

void prepare()
This method will be called by the engine on a dedicated thread (not the rendering thread) to allow the background construction of a Node. The Node will not be displayed until this method returns. Prepare may be called multiple times, even if the instance is already set up and tearDown() wasn't called, so implementation have to check, if they are already set up and return immediatly


setUp

void setUp()
This method will be called by the engine on the rendering thread to to allow thread safe attachment of the constructed content to the scenegraph. This method will be called after prepare().


tearDown

void tearDown()
This method will be called by the engine on the rendering thread to to allow thread safe detachment of the content from the scenegraph. The Node will be hidden before.


cleanUp

void cleanUp()
This method will be called by the engine on a dedicated thread (not the rendering thread) to allow the background destruction of a Node. This method will be called after tearDown().