Package org.lemsml.jlems.viz.plot
Class WorldTransform
- java.lang.Object
-
- org.lemsml.jlems.viz.plot.WorldTransform
-
public final class WorldTransform extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private double
aspectRatio
private int
bottomMargin
private int
canvasHeight
private int
canvasWidth
private boolean
constantAspectRatio
private int
dataAreaHeight
private int
dataAreaWidth
private static double
DBIG
private double
dpdwx
private double
dpdwx0
private double
dpdwy
private double
dpdwy0
private static int
IBIG
private int
leftMargin
private double[][]
m3B
private double
m3xx
private double
m3xy
private double
m3xz
private double
m3yx
private double
m3yy
private double
m3yz
private double
m3zx
private double
m3zy
private double
m3zz
private Size
p_pixelSize
private int
pcx
private int
pcy
private java.util.ArrayList<RangeListener>
rangeListeners
private boolean
recordRange
private int
rightMargin
private RotationListener
rotationListener
private static double
SMALL
private int
topMargin
private boolean
trialPanning
private double
vxmax
private double
vxmin
private double
vymax
private double
vymin
private double
w2cx
private double
w2cy
private double
w2cz
private double
w3cx
private double
w3cy
private double
w3cz
private double
wcx
private double
wcx0
private double
wcxtp
private double
wcy
private double
wcy0
private double
wcytp
private boolean
xRescalable
private boolean
yRescalable
private double
zoomCenX
private double
zoomCenY
-
Constructor Summary
Constructors Constructor Description WorldTransform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRangeListener(RangeListener rl)
(package private) void
applyRecordedRange()
(package private) void
applyRotation(double[][] mr)
(package private) void
axisRotate(double thax, double thr)
void
boxSelected(int x0, int y0, int x1, int y1)
(package private) void
clearRanges()
double[]
deProject(double x, double y, double z)
double
dPdX()
double
dPdY()
void
dragRollRotate(int idx, int idy)
(package private) void
dragZoom(double fxin, double fyin, int xc, int yc)
void
dragZRotate(int idx, int idy)
private void
enforceAspectRatioX()
private void
enforceAspectRatioY()
void
ensureCovers(double xl, double yl, double xh, double yh)
void
fixRanges()
(package private) float[]
floatDeviceX(double[] wx)
(package private) float[]
floatDeviceY(double[] wy)
protected float
fpowx(double xr)
protected float
fpowy(double yr)
double[]
get2Center()
double[]
get3Center()
int
getBottomMargin()
int
getCanvasHeight()
int
getCanvasWidth()
int
getHeight()
int[]
getIntPosition(double x, double y)
int
getLeftMargin()
double
getPixelArea()
Size
getPixelSize()
double[][]
getProjectionMatrix()
double
getScale()
int
getWidth()
double
getWorldCanvasWidth()
Position
getWorldPosition(int x, int y)
double[]
getXRange()
double[]
getXYXYLimits()
double[]
getYRange()
void
initializeRotation(double x, double y, double z)
void
initializeRotation(int ixcen, int iycen)
void
initializeRotationLocal(double x, double y, double z)
(package private) void
initializeZoom(int xc, int yc)
(package private) int[]
intDeviceX(double[] wx)
(package private) int[]
intDeviceY(double[] wy)
boolean
intIsOnCanvas(int x, int y)
boolean
isOnCanvas(double x, double y)
boolean
isShowing(double x, double y)
void
notifyRangeChange()
(package private) void
permanentPan(int xfrom, int yfrom, int xto, int yto)
protected int
powx(double xr)
protected int
powy(double yr)
void
printRot()
double[]
project(double x, double y, double z)
private void
pSetXRange(double xlin, double xhin)
private void
pSetYRange(double ylin, double yhin)
double
pubDxDpix()
double
pubDyDpix()
int
pubPixDx(double dxr)
int
pubPixDy(double dyr)
int
pubPowx(double xr)
int
pubPowy(double yr)
double
pubWopx(int x)
double
pubWopy(int y)
private int
qpowx(double xr)
private int
qpowy(double yr)
void
rangeChange()
void
reframe(Box b)
void
set2Center(double[] cen)
void
set3Center(double[] cen)
void
setAspectRatio(double f)
void
setAspectRatioFree()
void
setCanvasSize(int w, int h)
void
setFixedAspectRatio(double f)
void
setHeight(int h)
void
setMargins(int l, int r, int b, int t)
void
setPixelScalingFromTop(double d)
void
setProjectionMatrix(double[][] pm)
void
setRotationListener(RotationListener rl)
void
setScale(double sf)
void
setWidth(int w)
void
setXRange(double xl, double xh)
void
setXRescalable(boolean b)
void
setXYXYLimits(double xl, double yl, double xh, double yh)
void
setYRange(double yl, double yh)
void
setYRescalable(boolean b)
(package private) void
startRangeRecording()
(package private) void
stopRangeRecording()
(package private) void
trialPan(int xfrom, int yfrom, int xto, int yto)
boolean
visible3D(double x, double y, double z)
protected double
wopx(int x)
protected double
wopy(int y)
double
wxLeft()
double
wxRight()
double
wyBottom()
double
wyTop()
protected int
xpix(double xr)
protected double
xProj(double x, double y, double z)
private void
xZoomAbout(double f, int xc)
protected int
ypix(double yr)
protected double
yProj(double x, double y, double z)
private void
yZoomAbout(double f, int yc)
(package private) void
zoom(double xfac, double yfac, int xc, int yc)
(package private) void
zoom(double fac, int xc, int yc)
private void
zoomAbout(double fx, double fy, int xc, int yc)
private void
zoomAbout(double f, int xc, int yc)
protected double
zProj(double x, double y, double z)
void
zRotate(double theta)
-
-
-
Field Detail
-
wcx
private double wcx
-
wcy
private double wcy
-
pcx
private int pcx
-
pcy
private int pcy
-
canvasWidth
private int canvasWidth
-
canvasHeight
private int canvasHeight
-
dataAreaWidth
private int dataAreaWidth
-
dataAreaHeight
private int dataAreaHeight
-
dpdwx
private double dpdwx
-
dpdwy
private double dpdwy
-
leftMargin
private int leftMargin
-
rightMargin
private int rightMargin
-
topMargin
private int topMargin
-
bottomMargin
private int bottomMargin
-
xRescalable
private boolean xRescalable
-
yRescalable
private boolean yRescalable
-
IBIG
private static final int IBIG
- See Also:
- Constant Field Values
-
SMALL
private static final double SMALL
- See Also:
- Constant Field Values
-
DBIG
private static final double DBIG
- See Also:
- Constant Field Values
-
recordRange
private boolean recordRange
-
aspectRatio
private double aspectRatio
-
constantAspectRatio
private boolean constantAspectRatio
-
vxmin
private double vxmin
-
vxmax
private double vxmax
-
vymin
private double vymin
-
vymax
private double vymax
-
trialPanning
private boolean trialPanning
-
wcxtp
private double wcxtp
-
wcytp
private double wcytp
-
w2cx
private double w2cx
-
w2cy
private double w2cy
-
w2cz
private double w2cz
-
w3cx
private double w3cx
-
w3cy
private double w3cy
-
w3cz
private double w3cz
-
m3xx
private double m3xx
-
m3yy
private double m3yy
-
m3zz
private double m3zz
-
m3xy
private double m3xy
-
m3xz
private double m3xz
-
m3yx
private double m3yx
-
m3yz
private double m3yz
-
m3zx
private double m3zx
-
m3zy
private double m3zy
-
m3B
private double[][] m3B
-
zoomCenX
private double zoomCenX
-
zoomCenY
private double zoomCenY
-
dpdwx0
private double dpdwx0
-
dpdwy0
private double dpdwy0
-
wcx0
private double wcx0
-
wcy0
private double wcy0
-
rangeListeners
private java.util.ArrayList<RangeListener> rangeListeners
-
rotationListener
private RotationListener rotationListener
-
p_pixelSize
private final Size p_pixelSize
-
-
Method Detail
-
setCanvasSize
public void setCanvasSize(int w, int h)
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
getLeftMargin
public int getLeftMargin()
-
getBottomMargin
public int getBottomMargin()
-
setMargins
public void setMargins(int l, int r, int b, int t)
-
isOnCanvas
public boolean isOnCanvas(double x, double y)
-
intIsOnCanvas
public boolean intIsOnCanvas(int x, int y)
-
addRangeListener
public void addRangeListener(RangeListener rl)
-
setRotationListener
public void setRotationListener(RotationListener rl)
-
fixRanges
public void fixRanges()
-
rangeChange
public void rangeChange()
-
notifyRangeChange
public void notifyRangeChange()
-
setPixelScalingFromTop
public void setPixelScalingFromTop(double d)
-
setAspectRatioFree
public void setAspectRatioFree()
-
setFixedAspectRatio
public void setFixedAspectRatio(double f)
-
setAspectRatio
public void setAspectRatio(double f)
-
setXRescalable
public void setXRescalable(boolean b)
-
setYRescalable
public void setYRescalable(boolean b)
-
clearRanges
void clearRanges()
-
startRangeRecording
void startRangeRecording()
-
stopRangeRecording
void stopRangeRecording()
-
setWidth
public void setWidth(int w)
-
setHeight
public void setHeight(int h)
-
getCanvasWidth
public int getCanvasWidth()
-
getCanvasHeight
public int getCanvasHeight()
-
getWorldCanvasWidth
public double getWorldCanvasWidth()
-
isShowing
public boolean isShowing(double x, double y)
-
intDeviceX
int[] intDeviceX(double[] wx)
-
intDeviceY
int[] intDeviceY(double[] wy)
-
floatDeviceX
float[] floatDeviceX(double[] wx)
-
floatDeviceY
float[] floatDeviceY(double[] wy)
-
getPixelSize
public Size getPixelSize()
-
getPixelArea
public double getPixelArea()
-
wopx
protected double wopx(int x)
-
wopy
protected double wopy(int y)
-
xpix
protected int xpix(double xr)
-
ypix
protected int ypix(double yr)
-
powx
protected int powx(double xr)
-
powy
protected int powy(double yr)
-
fpowx
protected float fpowx(double xr)
-
fpowy
protected float fpowy(double yr)
-
qpowx
private int qpowx(double xr)
-
qpowy
private int qpowy(double yr)
-
pubPowx
public int pubPowx(double xr)
-
pubPowy
public int pubPowy(double yr)
-
getWorldPosition
public Position getWorldPosition(int x, int y)
-
pubWopx
public double pubWopx(int x)
-
pubWopy
public double pubWopy(int y)
-
pubPixDx
public int pubPixDx(double dxr)
-
pubPixDy
public int pubPixDy(double dyr)
-
dPdX
public double dPdX()
-
dPdY
public double dPdY()
-
pubDyDpix
public double pubDyDpix()
-
pubDxDpix
public double pubDxDpix()
-
wxLeft
public double wxLeft()
-
wxRight
public double wxRight()
-
wyBottom
public double wyBottom()
-
wyTop
public double wyTop()
-
enforceAspectRatioY
private void enforceAspectRatioY()
-
enforceAspectRatioX
private void enforceAspectRatioX()
-
zoomAbout
private void zoomAbout(double f, int xc, int yc)
-
zoomAbout
private void zoomAbout(double fx, double fy, int xc, int yc)
-
xZoomAbout
private void xZoomAbout(double f, int xc)
-
yZoomAbout
private void yZoomAbout(double f, int yc)
-
initializeZoom
void initializeZoom(int xc, int yc)
-
dragZoom
void dragZoom(double fxin, double fyin, int xc, int yc)
-
reframe
public void reframe(Box b)
-
setXRange
public void setXRange(double xl, double xh)
-
setYRange
public void setYRange(double yl, double yh)
-
pSetXRange
private void pSetXRange(double xlin, double xhin)
-
ensureCovers
public void ensureCovers(double xl, double yl, double xh, double yh)
-
pSetYRange
private void pSetYRange(double ylin, double yhin)
-
getXYXYLimits
public double[] getXYXYLimits()
-
getXRange
public double[] getXRange()
-
getYRange
public double[] getYRange()
-
setXYXYLimits
public void setXYXYLimits(double xl, double yl, double xh, double yh)
-
applyRecordedRange
void applyRecordedRange()
-
boxSelected
public void boxSelected(int x0, int y0, int x1, int y1)
-
zoom
void zoom(double fac, int xc, int yc)
-
zoom
void zoom(double xfac, double yfac, int xc, int yc)
-
trialPan
void trialPan(int xfrom, int yfrom, int xto, int yto)
-
permanentPan
void permanentPan(int xfrom, int yfrom, int xto, int yto)
-
getIntPosition
public int[] getIntPosition(double x, double y)
-
xProj
protected double xProj(double x, double y, double z)
-
yProj
protected double yProj(double x, double y, double z)
-
zProj
protected double zProj(double x, double y, double z)
-
project
public double[] project(double x, double y, double z)
-
deProject
public double[] deProject(double x, double y, double z)
-
initializeRotation
public void initializeRotation(int ixcen, int iycen)
-
initializeRotationLocal
public void initializeRotationLocal(double x, double y, double z)
-
initializeRotation
public void initializeRotation(double x, double y, double z)
-
applyRotation
void applyRotation(double[][] mr)
-
axisRotate
void axisRotate(double thax, double thr)
-
zRotate
public void zRotate(double theta)
-
printRot
public void printRot()
-
dragZRotate
public void dragZRotate(int idx, int idy)
-
dragRollRotate
public void dragRollRotate(int idx, int idy)
-
visible3D
public boolean visible3D(double x, double y, double z)
-
getProjectionMatrix
public double[][] getProjectionMatrix()
-
get3Center
public double[] get3Center()
-
get2Center
public double[] get2Center()
-
setProjectionMatrix
public void setProjectionMatrix(double[][] pm)
-
set3Center
public void set3Center(double[] cen)
-
set2Center
public void set2Center(double[] cen)
-
setScale
public void setScale(double sf)
-
getScale
public double getScale()
-
-