public class SLCamera extends java.lang.Object implements SLLocator, SLComponentEventListener
Modifier and Type | Field and Description |
---|---|
protected DblMatrix[] |
cameraBasis |
protected DblMatrix |
focus |
static int |
ORTHO_PERSPECTIVE |
protected DblMatrix |
phi |
protected DblMatrix |
psi |
static int |
SIMPLE_PERSPECTIVE |
protected DblMatrix |
theta |
static int |
X_AXIS |
protected DblMatrix |
XLim |
static int |
Y_AXIS |
protected DblMatrix |
YLim |
static int |
Z_AXIS |
protected DblMatrix |
ZLim |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(SLComponentEvent e)
Respond to updates in the positions/coordinates of existing components.
|
void |
addChangeListener(SLCameraChangeListener l) |
void |
centerView()
Pans the camera left/right and up/down to place the center the scene in the center of the frame.
|
void |
componentAdded(SLComponentEvent e)
This method is called when a component has been added.
|
void |
componentModified(SLComponentEvent e) |
void |
componentRemoved(SLComponentEvent e) |
void |
fireSLCameraChangeEvent(SLCameraChangeEvent ev) |
DblMatrix[] |
getCameraBasis() |
DblMatrix |
getCameraDirection()
Returns a unit vector (centered at the origin) indicating the direction of the camera.
|
static DblMatrix |
getCameraDirection(DblMatrix[] camBasis,
DblMatrix camPos)
Returns a unit vector (centered at the origin) indicating the direction of the camera.
|
java.lang.String |
getCameraName() |
DblMatrix |
getCameraPosition() |
DblMatrix |
getCameraStarboardDirection()
Returns a unit vector (centered at the origin) indicating the direction to the right of the camera.
|
static DblMatrix |
getCameraStarboardDirection(DblMatrix[] camBasis,
DblMatrix camPos)
Returns a unit vector (centered at the origin) indicating the direction to the right of the camera.
|
DblMatrix |
getCameraUpDirection()
Returns a unit vector (centered at the origin) indicating the direction up from the camera.
|
static DblMatrix |
getCameraUpDirection(DblMatrix[] camBasis,
DblMatrix camPos)
Returns a unit vector (centered at the origin) indicating the direction up from the camera.
|
DblMatrix |
getCoordinate(double[] pixel)
Return the actual coordinates for the given pixel.
|
DblMatrix |
getCoordinate(int[] pixel)
Return the actual coordinates for the given pixel.
|
int[] |
getDataBoundingBox() |
DblMatrix |
getDataUnitsPerPixel()
This method does not adjust or account for digital zoom.
|
DblMatrix |
getDigitalZoom() |
int |
getNumberOfComponents() |
SLAxes |
getParent() |
int |
getPerspectiveType() |
DblMatrix |
getPhi() |
int[] |
getPixel(DblMatrix cx,
DblMatrix cy)
Get the screen pixels of the given data (camera focus plane) coordinates using this SLLocator.
|
int[] |
getPixel(DblMatrix x,
DblMatrix y,
DblMatrix z) |
DblMatrix |
getPixelAsDbl(DblMatrix x,
DblMatrix y) |
DblMatrix |
getPixelAsDbl(DblMatrix x,
DblMatrix y,
DblMatrix z) |
float[] |
getPixelAsFloat(DblMatrix x,
DblMatrix y) |
float[] |
getPixelAsFloat(DblMatrix x,
DblMatrix y,
DblMatrix z) |
DblMatrix |
getPsi() |
int[] |
getScreenPixel(DblMatrix cx,
DblMatrix cy)
Get the physical screen pixels of the given data (camera focus plane) coordinates using this SLLocator.
|
DblMatrix |
getTheta() |
java.awt.Dimension |
getViewableBoundingBox()
Get's the size of the parent container (usually axes) in pixels.
|
DblMatrix |
getXDataUnitsPerPixel()
This method does not adjust or account for digital zoom.
|
DblMatrix |
getXLim() |
DblMatrix |
getYDataUnitsPerPixel()
This method does not adjust or account for digital zoom.
|
DblMatrix |
getYLim() |
DblMatrix |
getZLim() |
void |
lookAt(DblMatrix lba)
Rotate the view of the camera so that it is looking at the given coordinates.
|
void |
panAbout(DblMatrix reforigin,
DblMatrix deltatheta)
Pans the camera horizontally relative to a reference point.
|
void |
panAbout(DblMatrix reforigin,
DblMatrix deltatheta,
DblMatrix deltaphi)
Pans the camera relative to a reference point.
|
void |
panAbout(DblMatrix reforigin,
DblMatrix deltatheta,
DblMatrix deltaphi,
DblMatrix deltarho)
Pans the camera relative to a reference point.
|
void |
putInFrameUsing(DblMatrix direction)
Moves camera parallel to the given vector (anchored at the origin) until
all components are "in frame".
|
void |
putInFrameUsing(int axis)
Zooms the camera along the cardinal axis given so that all components are inside the
viewable frame.
|
void |
removeChangeListener(SLCameraChangeListener l) |
static DblMatrix |
rotatorFor(DblMatrix tt,
DblMatrix U)
Return in R a 3D rotation matrix that rotates an angle theta about the fixed unit vector u.
|
void |
setCameraName(java.lang.String nam) |
void |
setCameraPosition(DblMatrix x) |
void |
setDigitalZoom(DblMatrix x) |
void |
setDigitalZoom(java.lang.Double x) |
void |
setPerspectiveType(int L) |
void |
setPhi(DblMatrix x)
Sets the angle of rotation away from the z-axis.
|
void |
setPsi(DblMatrix x)
Sets the angle of axial rotation of the camera.
|
void |
setTheta(DblMatrix x)
Sets the angle of rotation away from the x-axis.
|
static void |
updateCameraBasis(DblMatrix[] camBasis,
DblMatrix Phi,
DblMatrix Theta,
DblMatrix Psi,
DblMatrix Position) |
void |
viewXY()
Sets a view down the z-axis keeping all components in frame.
|
void |
viewXYZ()
Sets camera to standard location for viewing a 3D scene.
|
void |
viewXZ()
Sets a view down the y-axis keeping all components in frame.
|
void |
viewYX()
Sets a view up the z-axis keeping all components in frame.
|
void |
viewYZ()
Sets a view down the x-axis keeping all components in frame.
|
void |
viewZX()
Sets a view up the y-axis keeping all components in frame.
|
void |
viewZY()
Sets a view up the x-axis keeping all components in frame.
|
public static final int X_AXIS
public static final int Y_AXIS
public static final int Z_AXIS
public static final int ORTHO_PERSPECTIVE
public static final int SIMPLE_PERSPECTIVE
protected DblMatrix theta
protected DblMatrix phi
protected DblMatrix psi
protected DblMatrix[] cameraBasis
protected DblMatrix focus
protected DblMatrix XLim
protected DblMatrix YLim
protected DblMatrix ZLim
public SLCamera(SLAxes p)
public void addChangeListener(SLCameraChangeListener l)
public void removeChangeListener(SLCameraChangeListener l)
public void setCameraName(java.lang.String nam)
public void fireSLCameraChangeEvent(SLCameraChangeEvent ev)
public java.lang.String getCameraName()
public DblMatrix getDigitalZoom()
public void setDigitalZoom(DblMatrix x)
public void setDigitalZoom(java.lang.Double x)
public int getPerspectiveType()
public void setPerspectiveType(int L)
public SLAxes getParent()
public int getNumberOfComponents()
public void componentModified(SLComponentEvent e)
public void componentAdded(SLComponentEvent e)
componentAdded
in interface SLComponentEventListener
public void componentRemoved(SLComponentEvent e)
componentRemoved
in interface SLComponentEventListener
public void actionPerformed(SLComponentEvent e)
actionPerformed
in interface SLComponentEventListener
public DblMatrix getCoordinate(int[] pixel)
getCoordinate
in interface SLLocator
public DblMatrix getDataUnitsPerPixel()
public DblMatrix getXDataUnitsPerPixel()
public DblMatrix getYDataUnitsPerPixel()
public DblMatrix getCoordinate(double[] pixel)
getCoordinate
in interface SLLocator
public int[] getScreenPixel(DblMatrix cx, DblMatrix cy)
public int[] getPixel(DblMatrix cx, DblMatrix cy)
public java.awt.Dimension getViewableBoundingBox()
public int[] getDataBoundingBox()
public static void updateCameraBasis(DblMatrix[] camBasis, DblMatrix Phi, DblMatrix Theta, DblMatrix Psi, DblMatrix Position)
public static DblMatrix rotatorFor(DblMatrix tt, DblMatrix U)
public void setCameraPosition(DblMatrix x)
public DblMatrix getCameraPosition()
public DblMatrix[] getCameraBasis()
public DblMatrix getCameraDirection()
public static DblMatrix getCameraDirection(DblMatrix[] camBasis, DblMatrix camPos)
public DblMatrix getCameraStarboardDirection()
public static DblMatrix getCameraStarboardDirection(DblMatrix[] camBasis, DblMatrix camPos)
public DblMatrix getCameraUpDirection()
public static DblMatrix getCameraUpDirection(DblMatrix[] camBasis, DblMatrix camPos)
public void setTheta(DblMatrix x)
public DblMatrix getTheta()
public void setPhi(DblMatrix x)
public DblMatrix getPhi()
public void setPsi(DblMatrix x)
public DblMatrix getPsi()
public float[] getPixelAsFloat(DblMatrix x, DblMatrix y)
getPixelAsFloat
in interface SLLocator
public float[] getPixelAsFloat(DblMatrix x, DblMatrix y, DblMatrix z)
getPixelAsFloat
in interface SLLocator
public DblMatrix getPixelAsDbl(DblMatrix x, DblMatrix y)
getPixelAsDbl
in interface SLLocator
public DblMatrix getPixelAsDbl(DblMatrix x, DblMatrix y, DblMatrix z)
getPixelAsDbl
in interface SLLocator
public void putInFrameUsing(int axis)
public void putInFrameUsing(DblMatrix direction)
public void lookAt(DblMatrix lba)
public void panAbout(DblMatrix reforigin, DblMatrix deltatheta, DblMatrix deltaphi, DblMatrix deltarho)
public void panAbout(DblMatrix reforigin, DblMatrix deltatheta, DblMatrix deltaphi)
public void panAbout(DblMatrix reforigin, DblMatrix deltatheta)
public void viewXYZ()
public void centerView()
public void viewXY()
public void viewYZ()
public void viewXZ()
public void viewYX()
public void viewZY()
public void viewZX()
Copyright © 2011, 2013. Daniel P. Dougherty