Class TLspViewTransformationUtil

java.lang.Object
com.luciad.view.lightspeed.util.TLspViewTransformationUtil

public class TLspViewTransformationUtil extends Object
Provides utility methods for configuring a view as either a 2D or 3D view. These methods instantiate an appropriate ALspViewXYZWorldTransformation and initialize it with sensible default parameters. If desirable, this class can also configure the new world-to-view transformation such that the visible area of the world with the new transformation remains approximately the same as with the old one. This allows, for instance, for a view to be switched back and forth between 2D and 3D without changing its currently viewed area.
Since:
2012.0
  • Method Details

    • setup3DView

      public static void setup3DView(ILspView aView, boolean aPreserveViewBounds)
      Switches the specified view to 3D. The world reference of the view will be set to a TLcdGeocentricReference with a WGS84 geodetic datum. In addition to the world reference, this method also sets the world-to-view transformation to a TLspViewXYZWorldTransformation3D.

      If aPreserveViewBounds is true then, after changing the world reference, the view is fit to approximately the same area it was viewing before the change of world reference. Otherwise, the view is fit to the entire bounds of the world.

      Parameters:
      aView - the view to be configured
      aPreserveViewBounds - true to preserve the visible area of the view
    • setup2DView

      public static void setup2DView(TLspViewXYZWorldTransformation2D aV2W, ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds)
      Switches the specified view to 2D using the requested world reference. In addition to the world reference, this method also sets the given world-to-view transformation.

      If aPreserveViewBounds is true then, after changing the world reference, the view is fit to approximately the same area it was viewing before the change of world reference. Otherwise the view is fit to the entire bounds of the world.

      Note that for 2D views, @code aWorldReference} should preferably be an ILcdGridReference. Other types, such as geocentric references may produce undesirable results.

      Parameters:
      aV2W - the given world-to-view transformation
      aView - the view to be configured
      aWorldReference - the world reference to set on the view
      aPreserveViewBounds - true to preserve the visible area of the view
    • setup3DView

      public static void setup3DView(ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds, boolean aAboveTerrain)
      Switches the specified view to 3D using the requested world reference. In addition to the world reference, this method also sets the world-to-view transformation to a TLspViewXYZWorldTransformation3D.

      If aPreserveViewBounds is true then, after changing the world reference, the view is fit to approximately the same area it was viewing before the change of world reference. Otherwise, the view is fit to the entire bounds of the world.

      Parameters:
      aView - the view to be configured
      aWorldReference - the world reference to set on the view
      aPreserveViewBounds - true to preserve the visible area of the view
      aAboveTerrain - true to constrain the camera over the terrain
    • setup3DView

      public static void setup3DView(TLspViewXYZWorldTransformation3D aV2W, ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds)
      Switches the specified view to 3D using the requested world reference. In addition to the world reference, this method also sets the given world-to-view transformation.

      If aPreserveViewBounds is true then, after changing the world reference, the view is fit to approximately the same area it was viewing before the change of world reference. Otherwise, the view is fit to the entire bounds of the world.

      Parameters:
      aV2W - a given world-to-view transformation.
      aView - the view to be configured
      aWorldReference - the world reference to set on the view
      aPreserveViewBounds - true to preserve the visible area of the view
    • setup2DView

      public static void setup2DView(ILspView aView, ILcdXYZWorldReference aWorldReference)
      Switches the specified view to 2D using the requested world reference. In addition to the world reference, this method also sets the world-to-view transformation to a TLspViewXYZWorldTransformation2D.

      Note that for 2D views, aWorldReference should preferably be an ILcdGridReference. Other types, such as geocentric references may produce undesirable results.

      Parameters:
      aView - the view to be configured
      aWorldReference - the world reference to set on the view
    • setup3DView

      public static void setup3DView(ILspView aView, ILcdXYZWorldReference aWorldReference)
      Switches the specified view to 3D using the requested world reference. In addition to the world reference, this method also sets the world-to-view transformation to a TLspViewXYZWorldTransformation3D.
      Parameters:
      aView - the view to be configured
      aWorldReference - the world reference to set on the view
    • setup2DView

      public static void setup2DView(ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds)
      Switches the specified view to 2D using the requested world reference, with the option to preserve the current view bounds. In addition to the world reference, this method also sets the world-to-view transformation to a TLspViewXYZWorldTransformation2D.

      If aPreserveViewBounds is true then, after changing the world reference, the view is fit to approximately the same area it was viewing before the change of world reference. Otherwise, the view is fit to the entire bounds of the world.

      Note that for 2D views, aWorldReference should preferably be an ILcdGridReference. Other types, such as geocentric references may produce undesirable results.

      Parameters:
      aView - the view to be configured
      aWorldReference - the world reference to set on the view
      aPreserveViewBounds - true to preserve the visible area of the view
    • setup3DView

      public static void setup3DView(ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds)
      Switches the specified view to 3D using the requested world reference, with the option to preserve the current view bounds. In addition to the world reference, this method also sets the world-to-view transformation to a TLspViewXYZWorldTransformation3D.

      If aPreserveViewBounds is true then, after changing the world reference, the view is fit to approximately the same area it was viewing before the change of world reference. Otherwise, the view is fit to the entire bounds of the world.

      Parameters:
      aView - the view to be configured
      aWorldReference - the world reference to set on the view
      aPreserveViewBounds - true to preserve the visible area of the view