Class TLspViewServices

java.lang.Object
com.luciad.view.lightspeed.TLspViewServices

public class TLspViewServices extends Object
An ILspView provides a number of useful services that can be leveraged by its layers, for performance or other reasons:
  • A render target stack allows for nested rendering into offscreen buffers. Each buffer is represented by an ILspRenderTarget. Rendering in the view is always directed into the topmost render target on the stack.
  • ILspVertexArrayRenderer is used to perform efficient management and rendering of vertex array data.
  • An ILspGLResourceCache is available to keep track of OpenGL resources such as texture objects. By using this mechanism, applications can monitor and restrict the amount of memory used for such resources.
  • ILcdMultiKeyCache provides a centralized cache for storing the results of expensive computations. Painters can use this cache, for instance, to save discretized and transformed representations of vector shapes, so as to avoid having to recompute these for every repaint of the view.
  • ILspTaskExecutor provides support for the asynchronous execution of processing tasks. Painters can use this mechanism to avoid overloading the event dispatch thread with expensive computations (such as discretization and transformation of geometry). The task executor also allows multiple painters to share a common thread pool, thus avoiding excessive thread spawning in applications with many different painters.
  • ILspTerrainSupport adds terrain support to the view. This enables terrain of flat 2D vector shapes and raster data on 3D terrains. Similar to transparency, the provided TLspPaintPass notifies painters whether or not objects are being draped.
Since:
2012.0
  • Method Details

    • getRenderTargetStack

      public Stack<ILspRenderTarget> getRenderTargetStack()
      Returns the stack of render targets for the view. Rendering is always directed to the topmost render target.
      Returns:
      a stack of ILspRenderTarget objects
    • getVertexArrayRenderer

      public ILspVertexArrayRenderer getVertexArrayRenderer()
      Returns the vertex array renderer which is associated with this view and which can be used by painters to draw into this view.
      Returns:
      an ILspVertexArrayRenderer for this view
    • getGLResourceCache

      public ILspGLResourceCache getGLResourceCache()
      Gets the resource cache that can be used to store and retrieve OpenGL resources from. Keys are strongly referenced and equality compared. Entries are pushed
      Returns:
      resource cache that is used to store and retrieve OpenGL resources.
    • getMultiKeyCache

      public ILcdMultiKeyCache getMultiKeyCache()
      Gets the cache that can be used to store and retrieve data for layers and painters used in this view. The keys in the cache are weakly referenced and entries are automatically removed from the cache when a key in the multi-key sequence is garbage collected. Key comparisons are identity based.
      Returns:
      the cache
    • getTaskExecutor

      public ILspTaskExecutor getTaskExecutor(ILspLayer aLayer)
      Returns the ILspTaskExecutor that is used to execute (asynchronous) tasks for the given layer. If the layer is an ALspLayer which is configured as synchronous, a non-threaded executor is returned.
      Parameters:
      aLayer - the layer that is requesting the executor
      Returns:
      the task executor
    • getTaskExecutor

      public ILspTaskExecutor getTaskExecutor()
      Returns the ILspTaskExecutor that is used to execute asynchronous tasks.

      The task executor is intended for tasks related to the visualization of data. For example operations that require a write lock on the model should not be executed on the task executor.

      Returns:
      the task executor
    • getTerrainSupport

      public ILspTerrainSupport getTerrainSupport()
      Support object for view's 3D terrain.

      Data can be painted relative to the terrain by configuring an ILspWorldElevationStyle.ElevationMode on the style.

      Returns:
      the view's 3D terrain
    • getGraphicsEffects

      public TLspGraphicsEffects getGraphicsEffects()
      Returns the central registry for global graphics effects such as fog and lighting.
      Returns:
      the central registry for global graphics effects such as fog and lighting