public class TLspViewTransformationUtil extends Object
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.Modifier and Type | Method and Description |
---|---|
static void |
setup2DView(ILspView aView,
ILcdXYZWorldReference aWorldReference)
Switches the specified view to 2D using the requested world reference.
|
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.
|
static void |
setup2DView(TLspViewXYZWorldTransformation2D aV2W,
ILspView aView,
ILcdXYZWorldReference aWorldReference,
boolean aPreserveViewBounds)
Switches the specified view to 2D using the requested world reference.
|
static void |
setup3DView(ILspView aView,
boolean aPreserveViewBounds)
Switches the specified view to 3D.
|
static void |
setup3DView(ILspView aView,
ILcdXYZWorldReference aWorldReference)
Switches the specified view to 3D using the requested world reference.
|
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.
|
static void |
setup3DView(ILspView aView,
ILcdXYZWorldReference aWorldReference,
boolean aPreserveViewBounds,
boolean aAboveTerrain)
Switches the specified view to 3D using the requested world reference.
|
static void |
setup3DView(TLspViewXYZWorldTransformation3D aV2W,
ILspView aView,
ILcdXYZWorldReference aWorldReference,
boolean aPreserveViewBounds)
Switches the specified view to 3D using the requested world reference.
|
public static void setup3DView(ILspView aView, boolean aPreserveViewBounds)
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.aView
- the view to be configuredaPreserveViewBounds
- true to preserve the visible area of the viewpublic static void setup2DView(TLspViewXYZWorldTransformation2D aV2W, ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds)
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.aV2W
- the given world-to-view transformationaView
- the view to be configuredaWorldReference
- the world reference to set on the viewaPreserveViewBounds
- true to preserve the visible area of the viewpublic static void setup3DView(ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds, boolean aAboveTerrain)
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.aView
- the view to be configuredaWorldReference
- the world reference to set on the viewaPreserveViewBounds
- true to preserve the visible area of the viewaAboveTerrain
- true to constrain the camera over the terrainpublic static void setup3DView(TLspViewXYZWorldTransformation3D aV2W, ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds)
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.aV2W
- a given world-to-view transformation.aView
- the view to be configuredaWorldReference
- the world reference to set on the viewaPreserveViewBounds
- true to preserve the visible area of the viewpublic static void setup2DView(ILspView aView, ILcdXYZWorldReference aWorldReference)
TLspViewXYZWorldTransformation2D
.
Note that for 2D views,
aWorldReference
should preferably be an ILcdGridReference
. Other types, such as geocentric references may produce undesirable
results.aView
- the view to be configuredaWorldReference
- the world reference to set on the viewpublic static void setup3DView(ILspView aView, ILcdXYZWorldReference aWorldReference)
TLspViewXYZWorldTransformation3D
.aView
- the view to be configuredaWorldReference
- the world reference to set on the viewpublic static void setup2DView(ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds)
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.aView
- the view to be configuredaWorldReference
- the world reference to set on the viewaPreserveViewBounds
- true to preserve the visible area of the viewpublic static void setup3DView(ILspView aView, ILcdXYZWorldReference aWorldReference, boolean aPreserveViewBounds)
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.aView
- the view to be configuredaWorldReference
- the world reference to set on the viewaPreserveViewBounds
- true to preserve the visible area of the view