org.deegree.tools.crs.georeferencing.application
Class Scene2DValues

java.lang.Object
  extended by org.deegree.tools.crs.georeferencing.application.Scene2DValues

public class Scene2DValues
extends Object

Helper for the Controller to handle operations in painting the scenes.

Version:
$Revision: 31215 $, $Date: 2011-07-05 14:46:01 +0200 (Tue, 05 Jul 2011) $
Author:
Steffen Thomas, last edited by: $Author: aschmitz $

Constructor Summary
Scene2DValues(GeometryFactory geom)
          Creates a new instance of Scene2DValues
 
Method Summary
 void computeZoomedEnvelope(boolean isZoomedIn, double resizing, AbstractGRPoint mousePosition)
          Computes the zoom of the envelope for the georeferencing scene or the footprint scene.
 Envelope createZoomedEnv(Envelope env, double newSize, AbstractGRPoint center)
          Creates the envelope for zoom in worldCoordinates.
 void createZoomedEnvWithMinPoint(AbstractGRPoint.PointType type, Rectangle rect)
          Creates a new envelope from an envelope and a centerPoint and translates it to the relative bounds.
 ICRS getCrs()
           
 Envelope getEnvelopeFootprint()
           
 Envelope getEnvelopeGeoref()
           
 Rectangle getGeorefDimension()
           
 int[] getPixelCoord(AbstractGRPoint abstractGRPoint)
          In this method firstly there is a computation from the span of the raster-envelope, after that the point is calculated relative to the min-point of the raster-envelope, after that the percent is computed and finally multiplicated with the imagedimension.
 List<String> getSelectedLayers()
           
 AbstractGRPoint getWorldDimension(AbstractGRPoint dimension)
          Converts the pixelDimension to a dimension with world coordinates.
 AbstractGRPoint getWorldPoint(AbstractGRPoint pixelPoint)
          Converts the pixelPoint to a point with world coordinates.
 void moveEnvelope(AbstractGRPoint mouseChange)
          Computes the translation of the envelope for the georeferencing scene or the footprint scene.
 void setCentroidWorldEnvelopePosition(double xCoord, double yCoord, AbstractGRPoint.PointType type)
          Sets the point as the centroid of the envelope.
 void setCentroidWorldEnvelopePosition(double xCoord, double yCoord, double spanX, double spanY, AbstractGRPoint.PointType type)
          Sets the points xCoord and yCoord as the centroid of the envelope with specified spans in x- and y-direction.
 void setDimensionFootpanel(Rectangle dimension)
           
 void setEnvelopeFootprint(Envelope createEnvelope)
           
 void setEnvelopeGeoref(double[] c, ICRS crs)
           
 void setEnvelopeGeoref(Envelope envelopeGeoref)
           
 void setGeorefDimension(Rectangle georefDimension)
           
 void transformAspectRatioGeorefPartial(Envelope envelope)
          Determines the ratio the boundingbox has to orient on.
 void transformProportionFullOrientationFoot(Envelope envelope)
           
 void transformProportionGeorefFullOrientation(Envelope envelope)
          The full orientation orients on the maximal span dimension.
 void transformProportionPartialOrientationFoot(Envelope envelope)
          Transforms the ratio of the dimensions of the footprintPanel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scene2DValues

public Scene2DValues(GeometryFactory geom)
Creates a new instance of Scene2DValues

Parameters:
geom -
Method Detail

getWorldPoint

public AbstractGRPoint getWorldPoint(AbstractGRPoint pixelPoint)
Converts the pixelPoint to a point with world coordinates.

Parameters:
pixelPoint - , not null
Returns:
an AbstractGRPoint in worldCoordinates

getWorldDimension

public AbstractGRPoint getWorldDimension(AbstractGRPoint dimension)
Converts the pixelDimension to a dimension with world coordinates.

Parameters:
dimension - , not null.
Returns:
an AbstractGRPoint in worldCoordinates.

getPixelCoord

public int[] getPixelCoord(AbstractGRPoint abstractGRPoint)
In this method firstly there is a computation from the span of the raster-envelope, after that the point is calculated relative to the min-point of the raster-envelope, after that the percent is computed and finally multiplicated with the imagedimension.

Parameters:
abstractGRPoint - the worldCoordinatePoint which should be translated back to pixelCoordinates, not be null
Returns:
an integer array with x, y - coordinates, z is not implemented yet.

getGeorefDimension

public Rectangle getGeorefDimension()

setGeorefDimension

public void setGeorefDimension(Rectangle georefDimension)

setDimensionFootpanel

public void setDimensionFootpanel(Rectangle dimension)

setCentroidWorldEnvelopePosition

public void setCentroidWorldEnvelopePosition(double xCoord,
                                             double yCoord,
                                             double spanX,
                                             double spanY,
                                             AbstractGRPoint.PointType type)
Sets the points xCoord and yCoord as the centroid of the envelope with specified spans in x- and y-direction. These parameters will be corrected if there is a mismatch regarding to the proportion of the requested envelope.

Parameters:
xCoord - x-coordiante in worldCoordinate-representation, not be null.
yCoord - y-coordiante in worldCoordinate-representation, not be null.
spanX - x-dimension that should be the width of the envelope, if not specified use -1 instead.
spanY - y-dimension that should be the height of the envelope, if not specified use -1 instead.

setCentroidWorldEnvelopePosition

public void setCentroidWorldEnvelopePosition(double xCoord,
                                             double yCoord,
                                             AbstractGRPoint.PointType type)
Sets the point as the centroid of the envelope.

Parameters:
xCoord - x-coordiante in worldCoordinate-representation, not be null.
yCoord - y-coordiante in worldCoordinate-representation, not be null.

moveEnvelope

public void moveEnvelope(AbstractGRPoint mouseChange)
Computes the translation of the envelope for the georeferencing scene or the footprint scene.

Parameters:
mouseChange - the translation of the scene in pixelCoordinates, not null

computeZoomedEnvelope

public void computeZoomedEnvelope(boolean isZoomedIn,
                                  double resizing,
                                  AbstractGRPoint mousePosition)
Computes the zoom of the envelope for the georeferencing scene or the footprint scene.

Parameters:
isZoomedIn - true, if one zoom in, otherwise false
resizing - the factor the scene should be resized → 0<resizing<1, could be null
mousePosition - where the zoom should orient on, not null

createZoomedEnv

public Envelope createZoomedEnv(Envelope env,
                                double newSize,
                                AbstractGRPoint center)
Creates the envelope for zoom in worldCoordinates.

Parameters:
env - to be zoomed, not null
newSize - the absolute value to be resized, not null.
center - in worldCoordinates where the zoom should orient on, not null
Returns:
the zoomed envelope.

createZoomedEnvWithMinPoint

public void createZoomedEnvWithMinPoint(AbstractGRPoint.PointType type,
                                        Rectangle rect)
Creates a new envelope from an envelope and a centerPoint and translates it to the relative bounds.


transformAspectRatioGeorefPartial

public void transformAspectRatioGeorefPartial(Envelope envelope)
Determines the ratio the boundingbox has to orient on. If there is a mismatch between the width and height this should influence the display of the image returned by the WMS to prevent any deformation.
  • pos - orientation on width because width is larger
  • neg - orientation on hight because hight is larger
  • other - orientation on width/hight because they are even
  • The partial orientation orients on the minimal span dimension.

    Parameters:
    envelope - to be transformed, mustn't be null.

    transformProportionGeorefFullOrientation

    public void transformProportionGeorefFullOrientation(Envelope envelope)
    The full orientation orients on the maximal span dimension.

    Parameters:
    envelope - to be transformed, must be not null.

    transformProportionPartialOrientationFoot

    public void transformProportionPartialOrientationFoot(Envelope envelope)
    Transforms the ratio of the dimensions of the footprintPanel.
    It takes the ratio between the dimension -width and -height and the ratio between the envelope -width and -height.

    Parameters:
    envelope - the footprint envelope that has to be transformed, must not be null.

    transformProportionFullOrientationFoot

    public void transformProportionFullOrientationFoot(Envelope envelope)

    getCrs

    public ICRS getCrs()

    setEnvelopeFootprint

    public void setEnvelopeFootprint(Envelope createEnvelope)

    setEnvelopeGeoref

    public void setEnvelopeGeoref(Envelope envelopeGeoref)

    setEnvelopeGeoref

    public void setEnvelopeGeoref(double[] c,
                                  ICRS crs)

    getSelectedLayers

    public List<String> getSelectedLayers()

    getEnvelopeFootprint

    public Envelope getEnvelopeFootprint()

    getEnvelopeGeoref

    public Envelope getEnvelopeGeoref()


    Copyright © 2011. All Rights Reserved.