public class ZoomPanState
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a clone of this zoomPan state.
|
processing.core.PVector |
getCoordToDisp(double x,
double y)
Transforms the given point from coordinate to display space.
|
processing.core.PVector |
getCoordToDisp(processing.core.PVector p)
Transforms the given point from coordinate to display space.
|
processing.core.PVector |
getDispToCoord(processing.core.PVector p)
Transforms the given point from display to coordinate space.
|
processing.core.PVector |
getPanOffset()
Reports the current pan offset.
|
double |
getZoomScale()
Reports the current zoom scale in X.
|
double |
getZoomScaleX()
Reports the current zoom scale in X.
|
double |
getZoomScaleY()
Reports the current zoom scale in Y.
|
void |
transform()
Performs the zooming/panning transformation.
|
void |
transform(processing.core.PGraphics offScreenBuffer)
Performs the zooming/panning transformation in the given graphics context.
|
public processing.core.PVector getDispToCoord(processing.core.PVector p)
p
- 2D point in zoomed display space.public processing.core.PVector getCoordToDisp(processing.core.PVector p)
p
- 2D point in original coordinate space.public processing.core.PVector getCoordToDisp(double x, double y)
x
- x location of the original coordinate space.y
- y location of the original coordinate space.public void transform()
public void transform(processing.core.PGraphics offScreenBuffer)
offScreenBuffer
- Graphics context in which to apply the zoom / pan transformation.public double getZoomScale()
public double getZoomScaleX()
public double getZoomScaleY()
public processing.core.PVector getPanOffset()
public java.lang.Object clone()
clone
in class java.lang.Object