Package com.luciad.view.gxy
Class TLcdGXYViewXYWorldTransformation
java.lang.Object
com.luciad.view.gxy.TLcdGXYViewXYWorldTransformation
- All Implemented Interfaces:
ILcdGXYViewXYWorldTransformation
,Serializable
,Cloneable
public class TLcdGXYViewXYWorldTransformation
extends Object
implements ILcdGXYViewXYWorldTransformation
This an implementation of the
ILcdGXYViewXYWorldTransformation
interface.- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a unitary transformation.TLcdGXYViewXYWorldTransformation
(ILcdGXYView aGXYView) Initializes the view origin, world origin and scale of the givenILcdGXYView
.TLcdGXYViewXYWorldTransformation
(Point aViewOrigin, double aScale) Constructs a transformation with the given view origin and scale.TLcdGXYViewXYWorldTransformation
(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScale) Constructs a transformation with the given view origin, world origin, and scale.TLcdGXYViewXYWorldTransformation
(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScale, double aRotation) Constructs a transformation with the given view origin, world origin, scale, and rotation.TLcdGXYViewXYWorldTransformation
(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScaleX, double aScaleY, double aRotation) Constructs a transformation with the given view origin, world origin, scale, and rotation. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of thisILcdGXYViewXYWorldTransformation
.boolean
double
Gets the rotation of thisILcdGXYViewXYWorldTransformation
in degrees.double
getScale()
Returns the scaling factor from world to view coordinates.double
Returns the scaling factor from world to view coordinates along the x-axis.double
Returns the scaling factor from world to view coordinates along the y-axis.Returns the viewOrigin value of thisTLcdGXYViewXYWorldTransformation
.Returns the worldOrigin value of thisTLcdGXYViewXYWorldTransformation
.void
setRotation
(double aRotation) Sets the rotation of thisILcdGXYViewXYWorldTransformation
in degrees.void
setScale
(double aScale) Sets the scaling factor from world to view coordinates.void
setupFor
(ILcdGXYView aGXYView) Setup with the view origin, world origin and scale of the givenILcdGXYView
.void
setViewOrigin
(int aX, int aY) Sets the view origin.void
setViewOrigin
(Point aViewOrigin) Sets the view origin.void
setWorldOrigin
(double aX, double aY) Sets the world origin.void
setWorldOrigin
(ILcdPoint aWorldOrigin) Sets the world origin.void
viewAWTBounds2worldSFCT
(Rectangle aViewRectangle, ILcd2DEditableBounds aWorldBoundsSFCT) Converts aRectangle
in AWT view coordinates to aILcd2DEditableBounds
in world coordinates.double
viewAWTDistance2world
(int aViewDistance) Converts a distance in AWT view space to a distance in world space.void
viewAWTPoint2worldSFCT
(Point aViewPoint, ILcd2DEditablePoint aWorldPointSFCT) Converts aPoint
in AWT view coordinates to aILcd2DEditablePoint
in world coordinates.void
viewXYBounds2worldSFCT
(ILcdBounds aViewBounds, ILcd2DEditableBounds aWorldBoundsSFCT) Converts aILcdBounds
in AWT view coordinates to aILcd2DEditableBounds
in world coordinates.double
viewXYDistance2world
(double aViewDistance) Converts a distance in AWT view space to a distance in world space.void
viewXYPoint2worldSFCT
(int aViewX, int aViewY, ILcd2DEditablePoint aWorldPointSFCT) Converts a (x,y) location in AWT view coordinates to aILcd2DEditablePoint
in world coordinates.void
viewXYPoint2worldSFCT
(ILcdPoint aViewPoint, ILcd2DEditablePoint aWorldPointSFCT) Converts anILcdPoint
in AWT view coordinates to aILcd2DEditablePoint
in world coordinates.void
worldBounds2viewAWTSFCT
(ILcdBounds aWorldBounds, Rectangle aRectangleSFCT) Converts aILcdBounds
in world coordinates to aRectangle
in AWT view coordinates.void
worldBounds2viewXYSFCT
(ILcdBounds aWorldBounds, ILcd2DEditableBounds aViewBoundsSFCT) Converts aILcdBounds
in world coordinates to aILcd2DEditableBounds
in AWT view coordinates.double
worldDistance2view
(double aWorldDistance) Converts a distance in world space to a distance in AWT view space.void
worldPoint2viewAWTPointSFCT
(ILcdPoint aWorldPoint, Point aViewPointSFCT) Converts anILcdPoint
in world coordinates to an AWTPoint
in AWT view coordinates.void
worldPoint2viewXYPointSFCT
(ILcdPoint aWorldPoint, ILcd2DEditablePoint aViewPointSFCT) Converts anILcdPoint
in world coordinates to aILcd2DEditablePoint
in AWT view coordinates.
-
Constructor Details
-
TLcdGXYViewXYWorldTransformation
public TLcdGXYViewXYWorldTransformation()Constructs a unitary transformation. -
TLcdGXYViewXYWorldTransformation
Constructs a transformation with the given view origin and scale. The world origin is taken to be (0,0).- Parameters:
aViewOrigin
- the view origin.aScale
- the scale to apply from world to view coordinates.
-
TLcdGXYViewXYWorldTransformation
Constructs a transformation with the given view origin, world origin, and scale.- Parameters:
aViewOrigin
- the view origin.aWorldOrigin
- the world origin.aScale
- scaling factor from world to view coordinates.
-
TLcdGXYViewXYWorldTransformation
Initializes the view origin, world origin and scale of the givenILcdGXYView
.- Parameters:
aGXYView
- the ILcdGXYView for which to construct the transformation.
-
TLcdGXYViewXYWorldTransformation
public TLcdGXYViewXYWorldTransformation(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScale, double aRotation) Constructs a transformation with the given view origin, world origin, scale, and rotation.- Parameters:
aViewOrigin
- the view origin.aWorldOrigin
- the world origin.aScale
- scaling factor from world to view coordinates.aRotation
- the rotation to apply around the world origin (in degrees).
-
TLcdGXYViewXYWorldTransformation
public TLcdGXYViewXYWorldTransformation(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScaleX, double aScaleY, double aRotation) Constructs a transformation with the given view origin, world origin, scale, and rotation.- Parameters:
aViewOrigin
- the view origin.aWorldOrigin
- the world origin.aScaleX
- scaling factor from world to view coordinates along x-axis.aScaleY
- scaling factor from world to view coordinates along y-axis.aRotation
- the rotation to apply around the world origin (in degrees).
-
-
Method Details
-
setupFor
Setup with the view origin, world origin and scale of the givenILcdGXYView
.- Parameters:
aGXYView
- theILcdGXYView
for which to initialize thisTLcdGXYViewXYWorldTransformation
.
-
getViewOrigin
Returns the viewOrigin value of thisTLcdGXYViewXYWorldTransformation
.- Returns:
- the viewOrigin value of this
TLcdGXYViewXYWorldTransformation
. - See Also:
-
setViewOrigin
public void setViewOrigin(int aX, int aY) Sets the view origin.- Parameters:
aX
- view x coordinate.aY
- view y coordinate.- See Also:
-
setViewOrigin
Sets the view origin.- Parameters:
aViewOrigin
- point to become new view origin.- See Also:
-
getWorldOrigin
Returns the worldOrigin value of thisTLcdGXYViewXYWorldTransformation
.- Returns:
- the worldOrigin value of this
TLcdGXYViewXYWorldTransformation
. - See Also:
-
setWorldOrigin
public void setWorldOrigin(double aX, double aY) Sets the world origin.- Parameters:
aX
- world x coordinate.aY
- world y coordinate.- See Also:
-
setWorldOrigin
Sets the world origin.- Parameters:
aWorldOrigin
-ILcdPoint
the new world origin. Only the 2 first coordinates are considered.- See Also:
-
getScale
public double getScale()Returns the scaling factor from world to view coordinates. If the scale along the x-axis differs from the scale along the y-axis, a mean value is returned. The scale corresponds to the number of pixels per world unit, as determined by theILcdXYWorldReference
. For example, a view displaying geographical data could use a scale in pixels per meter.- Returns:
- the scaling factor from world to view coordinates.
- See Also:
-
getScaleX
public double getScaleX()Returns the scaling factor from world to view coordinates along the x-axis. The scale corresponds to the number of pixels per world unit, as determined by theILcdXYWorldReference
. For example, a view displaying geographical data could use a scale in pixels per meter.- Returns:
- the scaling factor from world to view coordinates along the x-axis.
-
getScaleY
public double getScaleY()Returns the scaling factor from world to view coordinates along the y-axis. The scale corresponds to the number of pixels per world unit, as determined by theILcdXYWorldReference
. For example, a view displaying geographical data could use a scale in pixels per meter.- Returns:
- the scaling factor from world to view coordinates along the y-axis.
-
setScale
public void setScale(double aScale) Sets the scaling factor from world to view coordinates. The scale corresponds to the number of pixels per world unit, as determined by theILcdXYWorldReference
. For example, a view displaying geographical data could use a scale in pixels per meter.- Parameters:
aScale
- the scaling factor from world to view coordinates.- See Also:
-
getRotation
public double getRotation()Gets the rotation of thisILcdGXYViewXYWorldTransformation
in degrees. The rotation is positive counter-clockwise. The rotation is applied in the world reference system around the worldOrigin.- Returns:
- the rotation of this
ILcdGXYViewXYWorldTransformation
in degrees. - See Also:
-
setRotation
public void setRotation(double aRotation) Sets the rotation of thisILcdGXYViewXYWorldTransformation
in degrees. The rotation is positive counter-clockwise. The rotation is applied in the world reference system around the worldOrigin.- Parameters:
aRotation
- the rotation of thisILcdGXYViewXYWorldTransformation
in degrees.- See Also:
-
worldDistance2view
public double worldDistance2view(double aWorldDistance) Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts a distance in world space to a distance in AWT view space.- Specified by:
worldDistance2view
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aWorldDistance
- the distance to be converted.- Returns:
- the converted distance in view coordinates.
-
worldPoint2viewAWTPointSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts anILcdPoint
in world coordinates to an AWTPoint
in AWT view coordinates.- Specified by:
worldPoint2viewAWTPointSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aWorldPoint
- the worldILcdPoint
to transform.aViewPointSFCT
- the AWTPoint
to be set.
-
worldPoint2viewXYPointSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts anILcdPoint
in world coordinates to aILcd2DEditablePoint
in AWT view coordinates.- Specified by:
worldPoint2viewXYPointSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aWorldPoint
- the worldILcdPoint
to transform.aViewPointSFCT
- the AWTILcd2DEditablePoint
to be set.
-
viewAWTPoint2worldSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts aPoint
in AWT view coordinates to aILcd2DEditablePoint
in world coordinates.- Specified by:
viewAWTPoint2worldSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aViewPoint
- the AWT view coordinate to transform.aWorldPointSFCT
- the world point to be set.
-
viewXYPoint2worldSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts anILcdPoint
in AWT view coordinates to aILcd2DEditablePoint
in world coordinates.- Specified by:
viewXYPoint2worldSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aViewPoint
- the AWT view coordinate to transform.aWorldPointSFCT
- the world point to be set.
-
viewXYPoint2worldSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts a (x,y) location in AWT view coordinates to aILcd2DEditablePoint
in world coordinates.- Specified by:
viewXYPoint2worldSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aViewX
- the x-value of the AWT view coordinate to transform.aViewY
- the y-value of the AWT view coordinate to transform.aWorldPointSFCT
- the world point to be set.
-
viewAWTDistance2world
public double viewAWTDistance2world(int aViewDistance) Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts a distance in AWT view space to a distance in world space.- Specified by:
viewAWTDistance2world
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aViewDistance
- the distance to be converted.- Returns:
- the converted distance in world coordinates.
-
viewXYDistance2world
public double viewXYDistance2world(double aViewDistance) Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts a distance in AWT view space to a distance in world space.- Specified by:
viewXYDistance2world
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aViewDistance
- the distance to be converted.- Returns:
- the converted distance in world coordinates.
-
viewAWTBounds2worldSFCT
public void viewAWTBounds2worldSFCT(Rectangle aViewRectangle, ILcd2DEditableBounds aWorldBoundsSFCT) Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts aRectangle
in AWT view coordinates to aILcd2DEditableBounds
in world coordinates.- Specified by:
viewAWTBounds2worldSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aViewRectangle
- the bounds in AWT view coordinates to transform.aWorldBoundsSFCT
- the transformed world bounds to be set by the transformation.
-
viewXYBounds2worldSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts aILcdBounds
in AWT view coordinates to aILcd2DEditableBounds
in world coordinates.- Specified by:
viewXYBounds2worldSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aViewBounds
- the bounds in AWT view coordinates to transform.aWorldBoundsSFCT
- the transformed world bounds to be set by the transformation.
-
worldBounds2viewAWTSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts aILcdBounds
in world coordinates to aRectangle
in AWT view coordinates.- Specified by:
worldBounds2viewAWTSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aWorldBounds
- the bounds in world coordinates to transform.aRectangleSFCT
- the transformed AWT view bounds to be set by the transformation.
-
worldBounds2viewXYSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformation
Converts aILcdBounds
in world coordinates to aILcd2DEditableBounds
in AWT view coordinates.- Specified by:
worldBounds2viewXYSFCT
in interfaceILcdGXYViewXYWorldTransformation
- Parameters:
aWorldBounds
- the bounds in world coordinates to transform.aViewBoundsSFCT
- the transformed AWT view bounds to be set by the transformation.
-
equals
-
clone
Description copied from interface:ILcdGXYViewXYWorldTransformation
Returns a clone of thisILcdGXYViewXYWorldTransformation
.- Specified by:
clone
in interfaceILcdGXYViewXYWorldTransformation
- Overrides:
clone
in classObject
- Returns:
- a clone of this
ILcdGXYViewXYWorldTransformation
. - Throws:
CloneNotSupportedException
- if the object's class does not support cloning. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
-