org.jmol.viewer
Class TransformManager
abstract
class
TransformManager
extends Object
Method Summary |
void | addZoomTranslationNavigationText(StringBuffer sb) |
abstract void | adjustTemporaryScreenPoint()
adjusts the temporary point for perspective and offsets
|
void | applyRotation(Matrix3f mNew, boolean isInternal, BitSet bsAtoms) |
protected abstract void | calcCameraFactors()
sets all camera and scale factors needed by
the specific perspective model instantiated
|
protected void | calcNavigationPoint()
all navigation effects go through this method
|
protected void | calcSlabAndDepthValues()
sets slab and depth, possibly using visual range considerations
for setting the slab-clipping plane. (slab on; slab 0)
superceded in navigation mode
|
protected void | calcTransformMatrix() |
boolean | canNavigate() |
boolean | checkInternalSlab(Point3f pt) |
void | clear() |
void | clearSpin() |
void | clearVibration() |
float | defaultScaleToScreen(float radius) |
void | depthByPercentagePoints(int percentage) |
void | depthToPercent(int percentDepth) |
void | finalizeTransformParameters() |
void | getAxisAngle(AxisAngle4f axisAngle) |
String | getCenterText() |
Matrix3f | getMatrixRotate() |
Matrix4f | getMatrixtransform() |
String | getMoveToText(float timespan, boolean addComments) |
boolean | getNavigating() |
Point3f | getNavigationCenter() |
float | getNavigationDepthPercent() |
TransformManager | getNavigationManager(Viewer viewer, int width, int height) |
Point3f | getNavigationOffset() |
float | getNavigationOffsetPercent(char XorY) |
protected String | getNavigationState()
|
String | getNavigationText(boolean addComments) |
void | getNewFixedRotationCenter() |
Hashtable | getOrientationInfo() |
String | getOrientationText(int type) |
boolean | getPerspectiveDepth() |
protected abstract float | getPerspectiveFactor(float z)
calculate the perspective factor based on z |
String | getRotateXyzText() |
String | getRotateZyzText(boolean iAddComment) |
void | getRotation(Matrix3f matrixRotation) |
Point3f | getRotationCenter() |
float | getRotationRadius() |
String | getRotationText(boolean asQuaternion) |
Point4f | getSlabDepthPlane(boolean isDepth) |
int | getSlabPercentSetting() |
boolean | getSpinOn() |
String | getSpinState(boolean isAll) |
String | getState(StringBuffer sfunc) |
Matrix3f | getStereoRotationMatrix(boolean stereoFrame) |
String | getTransformText() |
String | getTranslationScript() |
float | getTranslationXPercent() |
float | getTranslationYPercent() |
float | getTranslationZPercent() |
Matrix4f | getUnscaledTransformMatrix() |
float | getZoomPercentFloat() |
float | getZoomSetting() |
void | homePosition() |
boolean | isInPosition(Point3f pt, float degrees) |
boolean | isNavigationCentered() |
boolean | isVibrationOn() |
boolean | isWindowCentered() |
protected void | matrixUnTransform(Point3f screen, Point3f angstroms) |
void | move(Vector3f dRot, float dZoom, Vector3f dTrans, float dSlab, float floatSecondsTotal, int fps) |
void | moveRotationCenter(Point3f center, boolean toXY) |
void | moveTo(float floatSecondsTotal, Point3f center, Point3f pt, float degrees, float zoom, float xTrans, float yTrans, float newRotationRadius, Point3f navCenter, float xNav, float yNav, float navDepth) |
void | moveTo(float floatSecondsTotal, Matrix3f end, Point3f center, float zoom, float xTrans, float yTrans, float newRotationRadius, Point3f navCenter, float xNav, float yNav, float navDepth) |
void | navigate(int keyCode, int modifiers)
entry point for keyboard-based navigation
|
void | navigate(float seconds, Point3f center)
scripted entry point for navigation
|
void | navigate(float seconds, Vector3f rotAxis, float degrees)
scripted entry point for navigation
|
void | navigate(float seconds, Point3f[] path, float[] theta, int indexStart, int indexEnd)
scripted navigation
|
void | navigate(float timeSeconds, Point3f[][] pathGuide)
follows a path guided by orientation and offset vectors (as Point3fs) |
void | navTranslate(float seconds, Point3f pt)
scripted entry point for navigation
|
void | navTranslatePercent(float seconds, float x, float y)
scripted entry point for navigation
|
protected void | resetNavigationPoint(boolean doResetSlab)
something has arisen that requires resetting of the navigation point. |
void | rotateAboutPointsInternal(Point3f point1, Point3f point2, float degrees, float endDegrees, boolean isClockwise, boolean isSpin, BitSet bsAtoms) |
protected void | rotateAxisAngle(Vector3f rotAxis, float radians) |
void | rotateAxisAngle(AxisAngle4f axisAngle, BitSet bsAtoms) |
void | rotateAxisAngleAtCenter(Point3f rotCenter, Vector3f rotAxis, float degrees, float endDegrees, boolean isSpin, BitSet bsAtoms) |
void | rotateAxisAngleRadiansFixed(float angleRadians, BitSet bsAtoms) |
void | rotateAxisAngleRadiansInternal(float radians, BitSet bsAtoms) |
void | rotateFront() |
void | rotatePoint(Point3f pt, Point3f ptRot) |
void | rotateX(float angleRadians) |
void | rotateXRadians(float angleRadians, BitSet bsAtoms) |
void | rotateXYBy(int xDelta, int yDelta, BitSet bsAtoms) |
void | rotateY(float angleRadians) |
void | rotateYRadians(float angleRadians, BitSet bsAtoms) |
void | rotateZ(float angleRadians) |
void | rotateZBy(int zDelta) |
void | rotateZRadians(float angleRadians) |
void | scaleFitToScreen(boolean andCenter) |
void | scaleFitToScreen(boolean andCenter, boolean zoomLarge, boolean resetSlab, boolean resetZoom) |
float | scaleToPerspective(int z, float sizeAngstroms) |
short | scaleToScreen(int z, int milliAngstroms) |
void | setAntialias(boolean TF) |
void | setCameraDepthPercent(float percent)
either as a percent -300, or as a float 3.0
note this percent is of zoom=100 size of model
|
void | setCenter() |
void | setCenterAt(String relativeTo, Point3f pt) |
void | setFixedRotationCenter(Point3f center) |
void | setNavigationDepthPercent(float timeSec, float percent)
sets the position of the navigation offset relative
to the model (50% center; 0% rear, 100% front; can be <0 or >100)
|
void | setNavigationMode(boolean TF) |
void | setNavigationSlabOffsetPercent(float offset) |
void | setNewRotationCenter(Point3f center, boolean doScale) |
void | setPerspectiveDepth(boolean perspectiveDepth) |
float | setRotateFixed(Point3f center, Vector3f axis, float degrees) |
float | setRotateInternal(Point3f center, Vector3f axis, float degrees) |
void | setRotateMolecule(boolean TF) |
void | setRotation(Matrix3f matrixRotation) |
void | setRotationCenterAndRadiusXYZ(Point3f newCenterOfRotation, boolean andRadius) |
void | setRotationCenterAndRadiusXYZ(String relativeTo, Point3f pt) |
void | setRotationPointXY(Point3f center) |
float | setRotationRadius(float angstroms, boolean doAll) |
void | setScaleAngstromsPerInch(float angstromsPerInch) |
void | setScreenParameters(int screenWidth, int screenHeight, boolean useZoomLarge, boolean antialias, boolean resetSlab, boolean resetZoom) |
void | setSlabDepthInternal(boolean isDepth)
set internal slab or depth from screen-based slab or depth |
void | setSlabEnabled(boolean slabEnabled) |
void | setSpinFps(int value) |
void | setSpinOn(boolean spinOn) |
void | setSpinOn(boolean spinOn, float endDegrees, BitSet bsAtoms) |
void | setSpinX(float degrees) |
void | setSpinY(float degrees) |
void | setSpinZ(float degrees) |
void | setStereoDegrees(float stereoDegrees) |
void | setStereoMode(int[] twoColors) |
void | setStereoMode(int stereoMode) |
void | setTranslationFractions() |
void | setVibrationOn(boolean vibrationOn) |
void | setVibrationPeriod(float period)
sets the period of vibration
-- period > 0: sets the period and turns vibration on
-- period < 0: sets the period but does not turn vibration on
-- period = 0: sets the period to zero and turns vibration off
-- period Float.NaN: uses current setting (frame change)
|
void | setVibrationScale(float scale) |
protected void | setVibrationT(float t) |
void | setViewer(Viewer viewer, int width, int height) |
void | setVisualRange(float angstroms) |
void | setWindowCentered(boolean TF) |
void | setZoomEnabled(boolean zoomEnabled) |
void | slabByPercentagePoints(int percentage) |
void | slabDepthByPercentagePoints(int percentage) |
void | slabInternal(Point4f plane, boolean isDepth) |
void | slabReset() |
void | slabToPercent(int percentSlab) |
void | transformPoint(Point3f pointAngstroms, Point3i pointScreen) |
Point3i | transformPoint(Point3f pointAngstroms)
CAUTION! |
Point3i | transformPoint(Point3f pointAngstroms, Vector3f vibrationVector) |
void | transformPoint(Point3f pointAngstroms, Point3f screen) |
void | transformPointNoClip(Point3f pointAngstroms, Point3f pointScreen) |
Point3f | transformPointNoClip(Point3f pointAngstroms)
CAUTION! |
void | transformPoints(int count, Point3f[] angstroms, Point3i[] screens) |
Point3i | transformScreenPoint(Point3f ptXyp) |
void | transformVector(Vector3f vectorAngstroms, Vector3f vectorTransformed) |
void | translateToXPercent(float percent) |
void | translateToYPercent(float percent) |
void | translateToZPercent(float percent) |
void | translateXYBy(int xDelta, int yDelta) |
static void | truncate0(StringBuffer sb, float val) |
static void | truncate2(StringBuffer sb, float val) |
void | unTransformPoint(Point3f screenPt, Point3f coordPt) |
protected void | zoomBy(int pixels)
standard response to user mouse vertical shift-drag
|
void | zoomByFactor(float factor) |
void | zoomByPercent(float percentZoom) |
void | zoomToPercent(float percentZoom) |
int | zValueFromPercent(int zPercent) |
protected final AxisAngle4f aaMoveTo
protected final AxisAngle4f aaStep
protected final Vector3f aaStepCenter
protected final Vector3f aaStepNavCenter
protected final AxisAngle4f aaTest1
protected final AxisAngle4f aaTotal
private boolean antialias
private final AxisAngle4f axisangleT
protected float cameraDepth
protected float cameraDepthSetting
protected float cameraDistance
protected float cameraScaleFactor
static final float degreesPerRadian
int depthPercentSetting
Point4f depthPlane
int depthValue
protected final AxisAngle4f fixedRotationAxis
protected final Point3f fixedRotationCenter
protected final Point3f fixedRotationOffset
protected final Point3f fixedTranslation
protected boolean haveNotifiedNaN
int height
private float internalRotationAngle
protected final AxisAngle4f internalRotationAxis
private final Point3f internalRotationCenter
boolean internalSlab
protected boolean isNavigationMode
boolean isSpinFixed
boolean isSpinInternal
boolean isSpinSelected
protected final Matrix3f matrixEnd
protected final Matrix3f matrixRotate
protected final Matrix3f matrixStart
private final Matrix3f matrixStartInv
protected final Matrix3f matrixStep
protected final Matrix3f matrixStereo
protected final Matrix4f matrixTemp
private final Matrix3f matrixTemp3
private final Matrix4f matrixTemp4
protected final Matrix3f matrixTest
protected final Matrix4f matrixTransform
protected float modelCenterOffset
protected float modelRadius
protected float modelRadiusPixels
static final int MAXIMUM_ZOOM_PERCENTAGE
static final int MAXIMUM_ZOOM_PERSPECTIVE_DEPTH
protected boolean navigating
protected final Point3f navigationCenter
protected final Point3f navigationOffset
protected final Point3f navigationShiftXY
protected boolean perspectiveDepth
protected int perspectiveModel
protected final Point3f point3fScreenTemp
private final Point3f point3fVibrationTemp
protected final Point3i point3iScreenTemp
protected final Point3f pointT
private final Point3f pointT2
protected Point3f ptMoveToCenter
protected final Point3f ptTest1
protected final Point3f ptTest2
protected final Point3f ptTest3
static final float radiansPerDegree
protected float referencePlaneOffset
private boolean rotateMolecule
Vector3f rotationAxis
private final Point3f rotationCenterDefault
private float rotationRadiusDefault
float rotationRate
protected boolean scale3D
float scale3DAngstromsPerInch
float scaleDefaultPixelsPerAngstrom
float scalePixelsPerAngstrom
int screenHeight
int screenPixelCount
int screenWidth
boolean slabEnabled
int slabPercentSetting
Point4f slabPlane
int slabValue
float spinFps
protected boolean spinOn
float spinX
float spinY
float spinZ
int[] stereoColors
float stereoDegrees
boolean stereoFrame
int stereoMode
float stereoRadians
static final float twoPI
private boolean useZoomLarge
private final Vector3f vectorT
private final Vector3f vectorT2
protected final Vector3f vectorTemp
private float vibrationAmplitude
boolean vibrationOn
private float vibrationPeriod
public int vibrationPeriodMs
private float vibrationRadians
private float vibrationScale
protected float visualRange
int width
boolean windowCentered
float xTranslationFraction
float yTranslationFraction
boolean zoomEnabled
float zoomPercent
float zoomPercentSetting
float zoomRatio
TransformManager()
TransformManager(
Viewer viewer)
TransformManager(
Viewer viewer, int width, int height)
private void addZoomTranslationNavigationText(StringBuffer sb)
abstract void adjustTemporaryScreenPoint()
adjusts the temporary point for perspective and offsets
private void applyRotation(Matrix3f mNew, boolean isInternal, BitSet bsAtoms)
protected abstract void calcCameraFactors()
sets all camera and scale factors needed by
the specific perspective model instantiated
protected void calcNavigationPoint()
all navigation effects go through this method
protected void calcSlabAndDepthValues()
sets slab and depth, possibly using visual range considerations
for setting the slab-clipping plane. (slab on; slab 0)
superceded in navigation mode
protected void calcTransformMatrix()
boolean canNavigate()
boolean checkInternalSlab(Point3f pt)
void clear()
private void clearSpin()
private void clearVibration()
private float defaultScaleToScreen(float radius)
void depthByPercentagePoints(int percentage)
void depthToPercent(int percentDepth)
void finalizeTransformParameters()
void getAxisAngle(AxisAngle4f axisAngle)
private String getCenterText()
Matrix3f getMatrixRotate()
Matrix4f getMatrixtransform()
String getMoveToText(float timespan, boolean addComments)
boolean getNavigating()
Point3f getNavigationCenter()
float getNavigationDepthPercent()
Point3f getNavigationOffset()
float getNavigationOffsetPercent(char XorY)
protected String getNavigationState()
Returns: the script that defines the current navigation state
String getNavigationText(boolean addComments)
void getNewFixedRotationCenter()
Hashtable getOrientationInfo()
String getOrientationText(int type)
boolean getPerspectiveDepth()
protected abstract float getPerspectiveFactor(float z)
calculate the perspective factor based on z
Parameters: z
Returns: perspectiveFactor
private String getRotateXyzText()
private String getRotateZyzText(boolean iAddComment)
void getRotation(Matrix3f matrixRotation)
Point3f getRotationCenter()
float getRotationRadius()
String getRotationText(boolean asQuaternion)
Point4f getSlabDepthPlane(boolean isDepth)
int getSlabPercentSetting()
boolean getSpinOn()
String getSpinState(boolean isAll)
String getState(StringBuffer sfunc)
Matrix3f getStereoRotationMatrix(boolean stereoFrame)
String getTransformText()
String getTranslationScript()
float getTranslationXPercent()
float getTranslationYPercent()
float getTranslationZPercent()
Matrix4f getUnscaledTransformMatrix()
float getZoomPercentFloat()
float getZoomSetting()
void homePosition()
boolean isInPosition(Point3f pt, float degrees)
boolean isNavigationCentered()
boolean isVibrationOn()
boolean isWindowCentered()
protected void matrixUnTransform(Point3f screen, Point3f angstroms)
void move(Vector3f dRot, float dZoom, Vector3f dTrans, float dSlab, float floatSecondsTotal, int fps)
private void moveRotationCenter(Point3f center, boolean toXY)
void moveTo(float floatSecondsTotal, Point3f center, Point3f pt, float degrees, float zoom, float xTrans, float yTrans, float newRotationRadius, Point3f navCenter, float xNav, float yNav, float navDepth)
void moveTo(float floatSecondsTotal, Matrix3f end, Point3f center, float zoom, float xTrans, float yTrans, float newRotationRadius, Point3f navCenter, float xNav, float yNav, float navDepth)
void navigate(int keyCode, int modifiers)
entry point for keyboard-based navigation
Parameters: keyCode 0 indicates key released modifiers shift,alt,ctrl
void navigate(float seconds, Point3f center)
scripted entry point for navigation
Parameters: seconds center
void navigate(float seconds, Vector3f rotAxis, float degrees)
scripted entry point for navigation
Parameters: seconds rotAxis degrees
void navigate(float seconds, Point3f[] path, float[] theta, int indexStart, int indexEnd)
scripted navigation
Parameters: seconds number of seconds to allow for total movement, like moveTo path sequence of points to turn into a hermetian path theta orientation angle along path (0 aligns with window Y axis)
[or Z axis if path is vertical] indexStart index of first "station" indexEnd index of last "station"
not implemented yet
void navigate(float timeSeconds, Point3f[][] pathGuide)
follows a path guided by orientation and offset vectors (as Point3fs)
Parameters: timeSeconds pathGuide
void navTranslate(float seconds, Point3f pt)
scripted entry point for navigation
Parameters: seconds pt
void navTranslatePercent(float seconds, float x, float y)
scripted entry point for navigation
Parameters: seconds x y
protected void resetNavigationPoint(boolean doResetSlab)
something has arisen that requires resetting of the navigation point.
Parameters: doResetSlab
void rotateAboutPointsInternal(Point3f point1, Point3f point2, float degrees, float endDegrees, boolean isClockwise, boolean isSpin, BitSet bsAtoms)
protected void rotateAxisAngle(Vector3f rotAxis, float radians)
void rotateAxisAngle(AxisAngle4f axisAngle, BitSet bsAtoms)
void rotateAxisAngleAtCenter(Point3f rotCenter, Vector3f rotAxis, float degrees, float endDegrees, boolean isSpin, BitSet bsAtoms)
void rotateAxisAngleRadiansFixed(float angleRadians, BitSet bsAtoms)
void rotateAxisAngleRadiansInternal(float radians, BitSet bsAtoms)
void rotateFront()
void rotatePoint(Point3f pt, Point3f ptRot)
void rotateX(float angleRadians)
void rotateXRadians(float angleRadians, BitSet bsAtoms)
void rotateXYBy(int xDelta, int yDelta, BitSet bsAtoms)
void rotateY(float angleRadians)
void rotateYRadians(float angleRadians, BitSet bsAtoms)
void rotateZ(float angleRadians)
void rotateZBy(int zDelta)
void rotateZRadians(float angleRadians)
void scaleFitToScreen(boolean andCenter)
void scaleFitToScreen(boolean andCenter, boolean zoomLarge, boolean resetSlab, boolean resetZoom)
float scaleToPerspective(int z, float sizeAngstroms)
short scaleToScreen(int z, int milliAngstroms)
void setAntialias(boolean TF)
void setCameraDepthPercent(float percent)
either as a percent -300, or as a float 3.0
note this percent is of zoom=100 size of model
Parameters: percent
void setCenter()
void setCenterAt(String relativeTo, Point3f pt)
private void setFixedRotationCenter(Point3f center)
void setNavigationDepthPercent(float timeSec, float percent)
sets the position of the navigation offset relative
to the model (50% center; 0% rear, 100% front; can be <0 or >100)
Parameters: timeSec percent
void setNavigationMode(boolean TF)
void setNavigationSlabOffsetPercent(float offset)
void setNewRotationCenter(Point3f center, boolean doScale)
void setPerspectiveDepth(boolean perspectiveDepth)
float setRotateFixed(Point3f center, Vector3f axis, float degrees)
float setRotateInternal(Point3f center, Vector3f axis, float degrees)
void setRotateMolecule(boolean TF)
void setRotation(Matrix3f matrixRotation)
private void setRotationCenterAndRadiusXYZ(Point3f newCenterOfRotation, boolean andRadius)
private void setRotationCenterAndRadiusXYZ(String relativeTo, Point3f pt)
void setRotationPointXY(Point3f center)
float setRotationRadius(float angstroms, boolean doAll)
void setScaleAngstromsPerInch(float angstromsPerInch)
void setScreenParameters(int screenWidth, int screenHeight, boolean useZoomLarge, boolean antialias, boolean resetSlab, boolean resetZoom)
void setSlabDepthInternal(boolean isDepth)
set internal slab or depth from screen-based slab or depth
Parameters: isDepth
void setSlabEnabled(boolean slabEnabled)
void setSpinFps(int value)
void setSpinOn(boolean spinOn)
private void setSpinOn(boolean spinOn, float endDegrees, BitSet bsAtoms)
void setSpinX(float degrees)
void setSpinY(float degrees)
void setSpinZ(float degrees)
void setStereoDegrees(float stereoDegrees)
void setStereoMode(int[] twoColors)
void setStereoMode(int stereoMode)
void setTranslationFractions()
private void setVibrationOn(boolean vibrationOn)
void setVibrationPeriod(float period)
sets the period of vibration
-- period > 0: sets the period and turns vibration on
-- period < 0: sets the period but does not turn vibration on
-- period = 0: sets the period to zero and turns vibration off
-- period Float.NaN: uses current setting (frame change)
Parameters: period
void setVibrationScale(float scale)
protected void setVibrationT(float t)
private void setViewer(
Viewer viewer, int width, int height)
void setVisualRange(float angstroms)
void setWindowCentered(boolean TF)
void setZoomEnabled(boolean zoomEnabled)
void slabByPercentagePoints(int percentage)
void slabDepthByPercentagePoints(int percentage)
void slabInternal(Point4f plane, boolean isDepth)
void slabReset()
void slabToPercent(int percentSlab)
void transformPoint(Point3f pointAngstroms, Point3i pointScreen)
Point3i transformPoint(Point3f pointAngstroms)
CAUTION! returns a POINTER TO A TEMPORARY VARIABLE
Parameters: pointAngstroms
Returns: POINTER TO point3iScreenTemp
Point3i transformPoint(Point3f pointAngstroms, Vector3f vibrationVector)
Parameters: pointAngstroms vibrationVector
Returns: POINTER TO TEMPORARY VARIABLE (caution!) point3iScreenTemp
void transformPoint(Point3f pointAngstroms, Point3f screen)
void transformPointNoClip(Point3f pointAngstroms, Point3f pointScreen)
Point3f transformPointNoClip(Point3f pointAngstroms)
CAUTION! returns a POINTER TO A TEMPORARY VARIABLE
Parameters: pointAngstroms
Returns: POINTER TO point3iScreenTemp
void transformPoints(int count, Point3f[] angstroms, Point3i[] screens)
private Point3i transformScreenPoint(Point3f ptXyp)
void transformVector(Vector3f vectorAngstroms, Vector3f vectorTransformed)
void translateToXPercent(float percent)
void translateToYPercent(float percent)
void translateToZPercent(float percent)
void translateXYBy(int xDelta, int yDelta)
private static void truncate0(StringBuffer sb, float val)
private static void truncate2(StringBuffer sb, float val)
void unTransformPoint(Point3f screenPt, Point3f coordPt)
protected void zoomBy(int pixels)
standard response to user mouse vertical shift-drag
Parameters: pixels
void zoomByFactor(float factor)
void zoomByPercent(float percentZoom)
void zoomToPercent(float percentZoom)
int zValueFromPercent(int zPercent)