Class TLsp3DArcBandEditor

java.lang.Object
com.luciad.view.lightspeed.editor.ALspEditor
com.luciad.view.lightspeed.editor.TLsp3DArcBandEditor
All Implemented Interfaces:
ILspEditor

public class TLsp3DArcBandEditor extends ALspEditor
Enables visual editing of ILcd3DEditableArcBand objects in an ILspView.

Handles

The 3D arc band editor defines the following edit handles for a 3D arc band object:
  • Handle located at (max radius, start angle, pitch start angle): This handle generates MOVE operations, with a HANDLE_IDENTIFIER user property with START_ANGLE_LOW_PITCH_CORNER as value.
  • Handle located at (max radius, start angle, pitch end angle): This handle generates MOVE operations, with a HANDLE_IDENTIFIER user property with START_ANGLE_HIGH_PITCH_CORNER as value.
  • Handle located at (max radius, end angle, pitch start angle): This handle generates MOVE operations, with a HANDLE_IDENTIFIER user property with END_ANGLE_LOW_PITCH_CORNER as value.
  • Handle located at (max radius, end angle, pitch end angle): This handle generates MOVE operations, with a HANDLE_IDENTIFIER user property with END_ANGLE_HIGH_PITCH_CORNER as value.
  • Height handle: allows the user to edit the height of the 3D arc band. This handle generates MOVE operations, with a HANDLE_IDENTIFIER user property with HEIGHT as value.
  • Arc band handles: The previously listed handles only allow editing of the pitch angles. Therefore, this editor, by default, also employs the handles used by TLspArcBandEditor. These allow the user to edit the 2D position, the min and max radius and the start and arc angle. For details, see its javadoc.
The following image clarifies the handle locations: the corner point handles are represented by red points, the green fill color indicates the area that can be used to activate the handle to move the shape up or down (note that the outline is also included in this area). The (projected) arc band underneath the 3D arc band provides the arc band handles obtained through the TLspArcBandEditor, as previously mentioned. Note that the center of the 3D arc band is not a handle.

The edit handles of a 3D arc band.

Editing

Based on the TLspEditOperation, generated by an edit handle (see description of handles above), this editor performs different edit operations on the associated 3d arc band object. The image below illustrates this. The gray color represents the previous state of the object and the red color represents the edited object. The editor adjusts the corresponding point of the 3d arc band. The figure below illustrates this behavior for the point located at (max radius, start angle, pitch end angle). The movement is depicted by the black arrow.

Editing a corner of a 3D arc band.

Creation

The initialization process of a 3D arc band consists of four distinct steps:
  1. The first step sets the center
  2. The second step initializes the minimum radius and the start angle
  3. The third step initializes the maximum radius and the arc angle
  4. The fourth step initializes the height
The figures below illustrate the creation process. Relevant changes that are new in each step are marked in red:

Setting the center point
Initializing minimum radius and start angle
Initializing maximum radius and arc angle
Initializing the height
Setting the center point Initializing minimum radius and start angle Initializing maximum radius and arc angle Initializing the height
Since:
2016.0
  • Constructor Details

    • TLsp3DArcBandEditor

      public TLsp3DArcBandEditor()
      Creates a new TLspArcBandEditor. This constructor initializes a default TLspArcBandEditor to be used as a delegate when editing arc angles.
    • TLsp3DArcBandEditor

      public TLsp3DArcBandEditor(TLspArcBandEditor aCustomArcBandEditorDelegate)
      Creates a new TLspArcBandEditor. This constructor uses the given TLspArcBandEditor as a delegate when editing arc angles.
      Parameters:
      aCustomArcBandEditorDelegate - the delegate arc band editor to be used for editing arc angles.
  • Method Details

    • canEdit

      public boolean canEdit(TLspEditContext aContext)
      Returns true if super returns true and the given object is an instance of ILcd3DEditableArcBand.
      Specified by:
      canEdit in interface ILspEditor
      Overrides:
      canEdit in class ALspEditor
      Parameters:
      aContext - provides context information to the editor
      Returns:
      true if the above conditions are met, false otherwise.
    • getEditHandles

      public List<ALspEditHandle> getEditHandles(TLspEditContext aContext)
      Returns a set of handles for editing the given object.

      These handles will be able to generate edit operations, that are passed to the edit method. As a way to communicate with this method, handles will copy their properties to the edit operation properties. By default this method delegates to the following methods:

      It returns a list containing the handles returned by those methods. These methods are added for convenience, so they can easily be overridden.
      Parameters:
      aContext - provides context information such as the layer for which the object is being edited
      Returns:
      the edit handles to edit the given object, or an empty list if it should not be possible to edit the given object.
      See Also:
    • createProjectedArcBandHandles

      protected List<ALspEditHandle> createProjectedArcBandHandles(TLspEditContext aContext)
      Creates edit handles that allows the user to edit the 3D arc band by using the edit handles of a 2D arc band. By default this means handles for the manipulation of the arc angle, min and max radius handles and a center handle to translate the entire object. The object on the context is a 2D arc band used to process the result of an edit.
      Parameters:
      aContext - the current context with a 2D arc band as the given shape.
      Returns:
      a list of edit handles
    • createObjectTranslationHandle

      protected ALspEditHandle createObjectTranslationHandle(ILcd3DEditableArcBand aArcBand, TLspEditContext aContext)
      Creates an edit handle that allows the user to translate the given shape.

      By default, in a 3D view, this handle is visualized as a 2D arc band. The returned handle is a TLspProjectedObjectTranslationHandle.

      By default, in a 2D view, the handle becomes a regular object translation handle. The returned handle is a TLspObjectTranslationHandle.

      Parameters:
      aArcBand - the shape for which the handle is created
      aContext - the current context
      Returns:
      an edit handle or null if no handle is needed
    • createHeightTranslationHandle

      protected ALspEditHandle createHeightTranslationHandle(ILcd3DEditableArcBand aArcBand, TLspEditContext aContext)
      Creates an edit handle that allows the user to alter the height above the terrain of the given shape by dragging it up/down.

      By default this method returns a TLspObjectHeightTranslationHandle with a HANDLE_IDENTIFIER property with HEIGHT as value.

      Note that by default this method only returns a height translation handle when the current view is a 3D view and the model reference is not view-space based. If this is not the case, this method returns null because then the height translation handle is not useful.

      Parameters:
      aArcBand - the arc band for which the handle is created
      aContext - the current context
      Returns:
      an edit handle or null if no handle is needed
    • createLowPitchHandleAtStartAngle

      protected ALspEditHandle createLowPitchHandleAtStartAngle(ILcd3DEditableArcBand aArcBand, TLspEditContext aContext)
      Creates an edit handle that allows the user to edit the pitch angles of the 3D arc band by translating the corner point located at (max radius, start angle, pitch start angle). By default this method returns a TLspPointTranslationHandle with a HANDLE_IDENTIFIER user property with START_ANGLE_LOW_PITCH_CORNER as value.
      Parameters:
      aArcBand - the arc for which the handle is created
      aContext - the current context
      Returns:
      an edit handle or null when no handle is needed
    • createHighPitchHandleAtStartAngle

      protected ALspEditHandle createHighPitchHandleAtStartAngle(ILcd3DEditableArcBand aArcBand, TLspEditContext aContext)
      Creates an edit handle that allows the user to edit the pitch angles of the 3D arc band by translating the corner point located at (max radius, start angle, pitch end angle). By default this method returns a TLspPointTranslationHandle with a HANDLE_IDENTIFIER user property with START_ANGLE_HIGH_PITCH_CORNER as value.
      Parameters:
      aArcBand - the arc for which the handle is created
      aContext - the current context
      Returns:
      an edit handle or null when no handle is needed
    • createLowPitchHandleAtEndAngle

      protected ALspEditHandle createLowPitchHandleAtEndAngle(ILcd3DEditableArcBand aArcBand, TLspEditContext aContext)
      Creates an edit handle that allows the user to edit the pitch angles of the 3D arc band by translating the corner point located at (max radius, end angle, pitch start angle). By default this method returns a TLspPointTranslationHandle with a HANDLE_IDENTIFIER user property with END_ANGLE_LOW_PITCH_CORNER as value.
      Parameters:
      aArcBand - the arc for which the handle is created
      aContext - the current context
      Returns:
      an edit handle or null when no handle is needed
    • createHighPitchHandleAtEndAngle

      protected ALspEditHandle createHighPitchHandleAtEndAngle(ILcd3DEditableArcBand aArcBand, TLspEditContext aContext)
      Creates an edit handle that allows the user to edit the pitch angles of the 3D arc band by translating the corner point located at (max radius, end angle, pitch end angle). By default this method returns a TLspPointTranslationHandle with a HANDLE_IDENTIFIER user property with END_ANGLE_HIGH_PITCH_CORNER as value.
      Parameters:
      aArcBand - the arc for which the handle is created
      aContext - the current context
      Returns:
      an edit handle or null when no handle is needed
    • getCreateHandle

      public ALspEditHandle getCreateHandle(TLspEditContext aContext)
      Returns a handle that is used to create the given object. The returned handle is used by the controller to initialize the other of the object.

      Typically the returned handle is an instance of ALspCreateHandle which is a specialized handle implementation used for creating an object.

      By default, this method returns an ALspCreateHandle capable of creating an ILcd3DEditableArcBand, as described in the class javadoc.

      Parameters:
      aContext - provides context information such as the layer for which the object is being created
      Returns:
      an edit handle, or null if creation should not be allowed.
      See Also:
    • editImpl

      public TLspEditOperationResult editImpl(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext)
      Called by the edit method to edit the given object based on the given edit operation.

      Note that this method does not need to lock the model of the object, this already happens in the edit method.

      Because this editor employs a TLspArcBandEditor and associated handles, this method delegates to said editor when necessary.

      Specified by:
      editImpl in class ALspEditor
      Parameters:
      aOperation - the event that contains the information on how to edit the object
      aInteractionStatus - the interaction status
      aContext - the edit context
      Returns:
      The result of the operation: Whether or not there was success, and whether or not the current handles of the object should be invalidated.