org.deegree_impl.graphics.transformation
Class WorldToScreenTransform

java.lang.Object
  extended byorg.deegree_impl.graphics.transformation.WorldToScreenTransform
All Implemented Interfaces:
GeoTransform

public class WorldToScreenTransform
extends java.lang.Object
implements GeoTransform

the class WorldToScreenTransform implements GeoTransformInterface and defines a transformation to a linear coordinat system with its orgin on top/left. this can be used for realising a screen mapping of geometries.

Version:
28.12.2000
Author:
Andreas Poth poth@lat-lon.de

Field Summary
private  GM_Envelope destRect
           
private  double qx
           
private  double qy
           
private  GM_Envelope sourceRect
           
 
Constructor Summary
WorldToScreenTransform()
          constructor initialices the transfromation rectangles with unique values (origin 0/0; widht 1; height 1)
WorldToScreenTransform(double sourceXMin, double sourceYMin, double sourceXMax, double sourceYMax, double destXMin, double destYMin, double destXMax, double destYMax)
          constrctor
WorldToScreenTransform(GM_Envelope sourceRect, GM_Envelope destRect)
          constructor initialices the transformation rectangle using the submitted source- and destination rectangle.
 
Method Summary
protected  void calculateQX()
          calculates the relation between the width of the destination and the source coordinate system.
protected  void calculateQY()
          calculates the relation between the height of the destination and the source coordinate system.
 GM_Position getDestPoint(GM_Position point)
          executes a coordinat transformation for the submitted point of the source coordinat system.
 GM_Envelope getDestRect()
           
 double getDestX(double xsource)
          executes a coordinat transformation for the submitted x-coordinate of the source coordinat system.
 double getDestY(double ysource)
          executes a coordinat transformation for the submitted y-coordinate of the source coordinat system.
 GM_Position getSourcePoint(GM_Position point)
          executes a coordinat transformation for the submitted point of the destination coordinate system.
 GM_Envelope getSourceRect()
           
 double getSourceX(double xdest)
          executes a coordinat transformation for the submitted x-coordinate of the destination coordinate system.
 double getSourceY(double ydest)
          executes a coordinat transformation for the submitted y-coordinate of the destination coordinate system.
 void setDestRect(double xMin, double yMin, double xMax, double yMax)
          sets the destination rectangle
 void setDestRect(GM_Envelope rect)
          sets the destination rectangle.
 void setSourceRect(double xMin, double yMin, double xMax, double yMax)
          sets the source rectangle
 void setSourceRect(GM_Envelope rect)
          sets the source rectangle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

qx

private double qx

qy

private double qy

sourceRect

private GM_Envelope sourceRect

destRect

private GM_Envelope destRect
Constructor Detail

WorldToScreenTransform

public WorldToScreenTransform()
constructor initialices the transfromation rectangles with unique values (origin 0/0; widht 1; height 1)


WorldToScreenTransform

public WorldToScreenTransform(GM_Envelope sourceRect,
                              GM_Envelope destRect)
constructor initialices the transformation rectangle using the submitted source- and destination rectangle.

Parameters:
sourceRect - is the boundary of the source geometry.
destRect - is the boundary of the destination rectangle (for example a region on the screen)

WorldToScreenTransform

public WorldToScreenTransform(double sourceXMin,
                              double sourceYMin,
                              double sourceXMax,
                              double sourceYMax,
                              double destXMin,
                              double destYMin,
                              double destXMax,
                              double destYMax)
constrctor

Parameters:
sourceXMin - minimum x-coordinate (source system) of the map.
sourceYMin - minimum y-coordinate (source system) of the map.
sourceXMax - maximum x-coordinate (source system) of the map.
sourceYMax - maximum y-coordinate (source system) of the map.
destXMin - minimum x-coordinate (destination system) of the map.
destYMin - minimum y-coordinate (destination system) of the map.
destXMax - maximum x-coordinate (destination system) of the map.
destYMax - maximum y-coordinate (destination system) of the map.
Method Detail

setSourceRect

public void setSourceRect(GM_Envelope rect)
sets the source rectangle

Specified by:
setSourceRect in interface GeoTransform
Parameters:
rect - is the boundary of the source geometry.

setSourceRect

public void setSourceRect(double xMin,
                          double yMin,
                          double xMax,
                          double yMax)
sets the source rectangle

Specified by:
setSourceRect in interface GeoTransform
Parameters:
xMin - minimum x-coordinate (source system) of the map.
yMin - minimum y-coordinate (source system) of the map.
xMax - maximum x-coordinate (source system) of the map.
yMax - maximum y-coordinate (source system) of the map.

getSourceRect

public GM_Envelope getSourceRect()
Specified by:
getSourceRect in interface GeoTransform
Returns:

setDestRect

public void setDestRect(GM_Envelope rect)
sets the destination rectangle.

Specified by:
setDestRect in interface GeoTransform
Parameters:
rect - is the boundary of the destination rectangle (for example a region on the screen)

setDestRect

public void setDestRect(double xMin,
                        double yMin,
                        double xMax,
                        double yMax)
sets the destination rectangle

Specified by:
setDestRect in interface GeoTransform
Parameters:
xMin - minimum x-coordinate (destination system) of the map.
yMin - minimum y-coordinate (destination system) of the map.
xMax - maximum x-coordinate (destination system) of the map.
yMax - maximum y-coordinate (destination system) of the map.

getDestRect

public GM_Envelope getDestRect()
Specified by:
getDestRect in interface GeoTransform
Returns:

getDestX

public double getDestX(double xsource)
executes a coordinat transformation for the submitted x-coordinate of the source coordinat system.

Specified by:
getDestX in interface GeoTransform
Parameters:
xsource -
Returns:
the x-coordinate of the submitted value in the destination coordinate system.

getDestY

public double getDestY(double ysource)
executes a coordinat transformation for the submitted y-coordinate of the source coordinat system.

Specified by:
getDestY in interface GeoTransform
Parameters:
ysource -
Returns:
the y-coordinate of the submitted value in the destination coordinate system.

getDestPoint

public GM_Position getDestPoint(GM_Position point)
executes a coordinat transformation for the submitted point of the source coordinat system.

Specified by:
getDestPoint in interface GeoTransform
Parameters:
point - in the source coordinate system.
Returns:
the location of the submitted point in the destination coordinate system.

getSourceX

public double getSourceX(double xdest)
executes a coordinat transformation for the submitted x-coordinate of the destination coordinate system.

Specified by:
getSourceX in interface GeoTransform
Parameters:
xdest -
Returns:
the x-coordinate of the submitted value in the source coordinate system.

getSourceY

public double getSourceY(double ydest)
executes a coordinat transformation for the submitted y-coordinate of the destination coordinate system.

Specified by:
getSourceY in interface GeoTransform
Parameters:
ydest -
Returns:
the y-coordinate of the submitted value in the source coordinate system.

getSourcePoint

public GM_Position getSourcePoint(GM_Position point)
executes a coordinat transformation for the submitted point of the destination coordinate system.

Specified by:
getSourcePoint in interface GeoTransform
Parameters:
point - in the destination coordinate system.
Returns:
the location of the submitted point in the source coordinate system.

calculateQX

protected void calculateQX()
calculates the relation between the width of the destination and the source coordinate system.


calculateQY

protected void calculateQY()
calculates the relation between the height of the destination and the source coordinate system.