Class TLspContext

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

public class TLspContext extends Object
Provides context information to be used when painting or editing an object in an ILspView. A TLspContext provides information such as:
  • the ILspView where the drawing or editing occurs,
  • the ILspLayer and therefore the ILcdModel the Object belongs to,
  • the ILcdGLDrawable in which to perform the drawing,
  • the ILcdModelXYZWorldTransformation to transform model coordinates into world coordinates and vice versa,
  • the ALspViewXYZWorldTransformation to transform world coordinates into view coordinates and vice versa,
Since:
2012.0
  • Constructor Details

    • TLspContext

      public TLspContext()
      Constructs a new uninitialized context. The view and layer are initially null; call the resetFor(com.luciad.view.lightspeed.layer.ILspLayer, ILspView) method before attempting to use this context.
    • TLspContext

      public TLspContext(ILspLayer aLayer, ILspView aView)
      Constructs a new context for the given view and layer.
      Parameters:
      aLayer - the layer for which to create a context
      aView - the view in which the layer is being painted
  • Method Details

    • resetFor

      public void resetFor(ILspLayer aLayer, ILspView aView)
      Initializes this context for the given view and layer.
      Parameters:
      aLayer - the layer for which to create a context
      aView - the view in which the layer is being painted
    • getDPIScale

      public double getDPIScale()
      Returns the DPI scaling factor for the view that is being rendered. The return value is typically greater than or equal to 1.0, with 1.0 indicating that no scaling is performed. Please refer to ALspViewXYZWorldTransformation for additional information about high DPI rendering support in Lightspeed views.
      Returns:
      the DPI scaling factor for the view that is being rendered
      Since:
      2019.0
    • getLayer

      public ILspLayer getLayer()
      Returns the layer that is being rendered.
      Returns:
      the layer that is being rendered
    • getView

      public ILspView getView()
      Returns the view that is being rendered.
      Returns:
      the view that is being rendered
    • getXYZWorldReference

      public ILcdXYZWorldReference getXYZWorldReference()
      Returns the world reference used by the associated view.
      Returns:
      the world reference
    • getModelXYZWorldTransformation

      public ILcdModelXYZWorldTransformation getModelXYZWorldTransformation()
      Returns the transformation that should be used to transform model points and bounds to world points and bounds or vice versa.
      Returns:
      the model to world transformation
    • getViewXYZWorldTransformation

      public ALspViewXYZWorldTransformation getViewXYZWorldTransformation()
      Returns the transformation that should be used to transform world points to view points or vice versa.
      Returns:
      the view to world transformation
    • getMapScale

      public TLcdMapScale getMapScale()
      Returns the map scale that should be used to determine the visibility and style of objects. This is usually the scale of the view, but might be different if a custom map scale provider is set on the layer.
      Returns:
      the map scale
      Since:
      2022.0
    • getModelReference

      public ILcdModelReference getModelReference()
      Returns the reference of the model contained in this context's layer.
      Returns:
      the reference of the model contained in this context's layer
    • getModel

      public ILcdModel getModel()
      Returns the model contained in this context's layer.
      Returns:
      the model contained in this context's layer