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 doubleaspectRatioprivate intbottomMarginprivate intcanvasHeightprivate intcanvasWidthprivate booleanconstantAspectRatioprivate intdataAreaHeightprivate intdataAreaWidthprivate static doubleDBIGprivate doubledpdwxprivate doubledpdwx0private doubledpdwyprivate doubledpdwy0private static intIBIGprivate intleftMarginprivate double[][]m3Bprivate doublem3xxprivate doublem3xyprivate doublem3xzprivate doublem3yxprivate doublem3yyprivate doublem3yzprivate doublem3zxprivate doublem3zyprivate doublem3zzprivate Sizep_pixelSizeprivate intpcxprivate intpcyprivate java.util.ArrayList<RangeListener>rangeListenersprivate booleanrecordRangeprivate intrightMarginprivate RotationListenerrotationListenerprivate static doubleSMALLprivate inttopMarginprivate booleantrialPanningprivate doublevxmaxprivate doublevxminprivate doublevymaxprivate doublevyminprivate doublew2cxprivate doublew2cyprivate doublew2czprivate doublew3cxprivate doublew3cyprivate doublew3czprivate doublewcxprivate doublewcx0private doublewcxtpprivate doublewcyprivate doublewcy0private doublewcytpprivate booleanxRescalableprivate booleanyRescalableprivate doublezoomCenXprivate doublezoomCenY
-
Constructor Summary
Constructors Constructor Description WorldTransform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRangeListener(RangeListener rl)(package private) voidapplyRecordedRange()(package private) voidapplyRotation(double[][] mr)(package private) voidaxisRotate(double thax, double thr)voidboxSelected(int x0, int y0, int x1, int y1)(package private) voidclearRanges()double[]deProject(double x, double y, double z)doubledPdX()doubledPdY()voiddragRollRotate(int idx, int idy)(package private) voiddragZoom(double fxin, double fyin, int xc, int yc)voiddragZRotate(int idx, int idy)private voidenforceAspectRatioX()private voidenforceAspectRatioY()voidensureCovers(double xl, double yl, double xh, double yh)voidfixRanges()(package private) float[]floatDeviceX(double[] wx)(package private) float[]floatDeviceY(double[] wy)protected floatfpowx(double xr)protected floatfpowy(double yr)double[]get2Center()double[]get3Center()intgetBottomMargin()intgetCanvasHeight()intgetCanvasWidth()intgetHeight()int[]getIntPosition(double x, double y)intgetLeftMargin()doublegetPixelArea()SizegetPixelSize()double[][]getProjectionMatrix()doublegetScale()intgetWidth()doublegetWorldCanvasWidth()PositiongetWorldPosition(int x, int y)double[]getXRange()double[]getXYXYLimits()double[]getYRange()voidinitializeRotation(double x, double y, double z)voidinitializeRotation(int ixcen, int iycen)voidinitializeRotationLocal(double x, double y, double z)(package private) voidinitializeZoom(int xc, int yc)(package private) int[]intDeviceX(double[] wx)(package private) int[]intDeviceY(double[] wy)booleanintIsOnCanvas(int x, int y)booleanisOnCanvas(double x, double y)booleanisShowing(double x, double y)voidnotifyRangeChange()(package private) voidpermanentPan(int xfrom, int yfrom, int xto, int yto)protected intpowx(double xr)protected intpowy(double yr)voidprintRot()double[]project(double x, double y, double z)private voidpSetXRange(double xlin, double xhin)private voidpSetYRange(double ylin, double yhin)doublepubDxDpix()doublepubDyDpix()intpubPixDx(double dxr)intpubPixDy(double dyr)intpubPowx(double xr)intpubPowy(double yr)doublepubWopx(int x)doublepubWopy(int y)private intqpowx(double xr)private intqpowy(double yr)voidrangeChange()voidreframe(Box b)voidset2Center(double[] cen)voidset3Center(double[] cen)voidsetAspectRatio(double f)voidsetAspectRatioFree()voidsetCanvasSize(int w, int h)voidsetFixedAspectRatio(double f)voidsetHeight(int h)voidsetMargins(int l, int r, int b, int t)voidsetPixelScalingFromTop(double d)voidsetProjectionMatrix(double[][] pm)voidsetRotationListener(RotationListener rl)voidsetScale(double sf)voidsetWidth(int w)voidsetXRange(double xl, double xh)voidsetXRescalable(boolean b)voidsetXYXYLimits(double xl, double yl, double xh, double yh)voidsetYRange(double yl, double yh)voidsetYRescalable(boolean b)(package private) voidstartRangeRecording()(package private) voidstopRangeRecording()(package private) voidtrialPan(int xfrom, int yfrom, int xto, int yto)booleanvisible3D(double x, double y, double z)protected doublewopx(int x)protected doublewopy(int y)doublewxLeft()doublewxRight()doublewyBottom()doublewyTop()protected intxpix(double xr)protected doublexProj(double x, double y, double z)private voidxZoomAbout(double f, int xc)protected intypix(double yr)protected doubleyProj(double x, double y, double z)private voidyZoomAbout(double f, int yc)(package private) voidzoom(double xfac, double yfac, int xc, int yc)(package private) voidzoom(double fac, int xc, int yc)private voidzoomAbout(double fx, double fy, int xc, int yc)private voidzoomAbout(double f, int xc, int yc)protected doublezProj(double x, double y, double z)voidzRotate(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()
-
-