Class TLspProjectedObjectTranslationHandle


public class TLspProjectedObjectTranslationHandle extends TLspObjectTranslationHandle
An edit handle that allows the user to translate a 3D shape, by dragging the projected shape across the terrain.

By default, this handle supports the following 3D objects:

  • ILcdEditableExtrudedShape: the projected shape is the base shape drawn on the terrain
  • ILcd3DEditableBounds: the projected shapes is a 2D bounds drawn on the terrain
  • ILcd3DEditableSphere and ILcd3DEditableDome: the projected shape is a circle on the terrain
  • ILcd3DEditablePointList: the projected shape is a 2D polyline drawn on the terrain
  • ILcdVariableGeoBuffer: The projected shape is a variable geobuffer on the terrain.
  • TLcdLonLatHeightBuffer: The projected shape is a lon-lat buffer drawn on the terrain.
Override the getProjectedShape method to support custom shapes.
Since:
2012.0
  • Constructor Details

    • TLspProjectedObjectTranslationHandle

      public TLspProjectedObjectTranslationHandle(Object aObject)
  • Method Details

    • getStyleTargetProviders

      public List<ALspStyleTargetProvider> getStyleTargetProviders(TLspHandleGeometryType aType)
      Description copied from class: ALspHandle
      Returns a style target provider that can generate geometry for the given visual editing component type, or an empty list if no geometry can be generated for the given type. TLspEditHandleStyler allows you to register different styles for each visual component type.
      Overrides:
      getStyleTargetProviders in class TLspObjectTranslationHandle
      Parameters:
      aType - a visual editing component type
      Returns:
      a list of style target providers, or an empty list if no style targets can be created for the given visual editing component type
    • isObjectTouched

      protected boolean isObjectTouched(int aX, int aY, TLspEditContext aEditContext)
      Description copied from class: ALspObjectTranslationHandle
      Returns whether the edited object is touched.

      The default implementation queries the layer of the edited object using a touch query, using the paint representation specified at construction time.

      Overrides:
      isObjectTouched in class ALspObjectTranslationHandle
      Parameters:
      aX - the x coordinate in the view
      aY - the y coordinate in the view
      aEditContext - the edit context
      Returns:
      true if the object is touched
    • getProjectedShape

      protected ILcdShape getProjectedShape(Object aGeometry, TLspContext aContext)
      Returns the projected shape of the given geometry. By default, this method supports the following 3D objects:
      • ILcdEditableExtrudedShape: the projected shape is the base shape drawn on the terrain
      • ILcd3DEditableBounds: the projected shapes is a 2D bounds drawn on the terrain
      • ILcd3DEditableSphere and ILcd3DEditableDome: the projected shape is a circle on the terrain
      • ILcd3DEditablePointList: the projected shape is a 2D polyline drawn on the terrain
      • ILcdVariableGeoBuffer: The projected shape is a variable geobuffer on the terrain.
      • TLcdLonLatHeightBuffer: The projected shape is a lon-lat buffer drawn on the terrain.
      If a given shape is not supported, this implementation throws a IllegalArgumentException.

      Override this method to add support for other shapes.

      Parameters:
      aGeometry - the shape for which a projected shape should be returned.
      aContext - the context in which the projected shape will be painted, i.e. this context contains the layer in which this handle is painted.
      Returns:
      the projected shape of the given geometry.