Package org.jmol.viewer
Class TransformManager
java.lang.Object
org.jmol.viewer.TransformManager
- Direct Known Subclasses:
TransformManager4D
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final A4
protected boolean
protected float
final P3
protected float
protected float
float
protected float
protected float
final P3
static final int
static final float
int
static final double
int
protected boolean
final A4
final P3
final P3
final P3
protected final P3
protected boolean
int
final A4
boolean
protected V3
protected final P3i
boolean
boolean
final M3
protected final M3
protected final M4
protected final M3
protected final M3
final M4
final M4
static final int
int
static final int
static final int
static final int
float
float
float
static final int
static final int
static final int
static final int
static final int
static final int
static final int
float
boolean
final P3
float
final P3
final P3
float
int
boolean
float
float
float
boolean
protected int
protected final P3
protected final P3
float
float
protected float
protected final P3
protected final P3
protected final P3
float
protected boolean
float
int
boolean
int
float
boolean
float
float
float
protected final P3
protected final V3
boolean
int
float
protected Viewer
int
boolean
int
int
float
zoom percent zmPct is the current displayed zoom value, AFTER rendering; may not be the same as zmPctSet, particularly if zoom is not enabledboolean
float
boolean
int
int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
sets all camera and scale factors needed by the specific perspective model instantiatedprotected void
All the magic happens here.void
sets slab and depth, possibly using visual range considerations for setting the slab-clipping plane.void
void
float
defaultScaleToScreen
(float radius) void
depthToPercent
(int percentDepth) void
float
P3[]
This method returns data needed by the VRML, X3D, and IDTF/U3D exporters.getMoveToText
(float timespan, boolean addComments) float
getNavigationOffsetPercent
(char XorY) protected String
protected String
getNavigationText
(boolean addComments) float
boolean
float
getPerspectiveFactor
(float z) calculate the perspective factor based on zvoid
getRotation
(M3 m) protected void
getScreenTemp
(T3 ptXYZ) int
float
float
getVibrationPoint
(Vibration v, T3 pt, float scale) returnfloat
void
homePosition
(boolean resetSpin) boolean
isInPosition
(V3 axis, float degrees) boolean
boolean
void
moveRotationCenter
(P3 center, boolean toXY) boolean
moveToPyMOL
(JmolScriptEvaluator eval, float floatSecondsTotal, float[] pymolView) void
navigateAxis
(V3 rotAxis, float degrees) scripted entry point for navigationvoid
navigateList
(JmolScriptEvaluator eval, Lst<Object[]> list) void
navTranslatePercentOrTo
(float seconds, float x, float y) seconds invalid input: '<' 0 means "to (x,y)"; >= 0 mean "to (x%, y%)"int
percentToPixels
(char xyz, float percent) protected void
resetNavigationPoint
(boolean doResetSlab) something has arisen that requires resetting of the navigation point.void
protected void
rotate3DBall
(float xDeg, float yDeg, BS bsAtoms) void
rotateAxisAngle
(V3 rotAxis, float radians) void
rotateAxisAngleRadiansFixed
(float angleRadians, BS bsAtoms) void
rotateAxisAngleRadiansInternal
(float radians, BS bsAtoms, M4 m4, boolean useModelKit) void
rotatePoint
(T3 pt, T3 ptRot) void
rotateXRadians
(float angleRadians, BS bsAtoms) protected void
rotateXYBy
(float degX, float degY, BS bsAtoms) void
rotateYRadians
(float angleRadians, BS bsAtoms) void
rotateZRadians
(float angleRadians) float
scaleToPerspective
(int z, float sizeAngstroms) float
scaleToScreen
(int z, int milliAngstroms) void
setAll
(P3 center, M3 m, P3 navCenter, float zoom, float xTrans, float yTrans, float rotationRadius, float pixelScale, float navDepth, float xNav, float yNav, float cameraDepth, float cameraX, float cameraY) void
setCamera
(float x, float y) void
setCameraDepthPercent
(float percent, boolean resetSlab) either as a percent -300, or as a float 3.0 note this percent is of zoom=100 size of modelvoid
setCenterAt
(int relativeTo, P3 pt) protected void
setNavFps
(int navFps) void
setNavigatePt
(P3 pt) scripted entry point for navigationvoid
setNavigationDepthPercent
(float percent) sets the position of the navigation offset relative to the model (50% center; 0% rear, 100% front; can be invalid input: '<'0 or >100)void
void
setNavOn
(boolean navOn) void
setNavXYZ
(float x, float y, float z) void
setRotation
(M3 m) float
setRotationRadius
(float angstroms, boolean doAll) void
setSlabDepthInternal
(boolean isDepth) set internal slab or depth from screen-based slab or depthvoid
setSlabRange
(float value) void
void
void
setVibrationPeriod
(float period) sets the period of vibration -- period > 0: sets the period and turns vibration on -- period invalid input: '<' 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
setVibrationT
(float t) void
setZoomHeight
(boolean zoomHeight, boolean zoomLarge) void
slabInternal
(P4 plane, boolean isDepth) void
void
slabToPercent
(int percentSlab) void
transformPt
(T3 ptXYZ) CAUTION! returns a POINTER TO A TEMPORARY VARIABLEtransformPt2D
(T3 ptXyp) void
transformPt2Df
(T3 v, P3 pt) void
transformPt3f
(T3 ptXYZ, P3 screen) void
transformPtNoClip
(T3 ptXYZ, T3 pointScreen) void
transformPtScr
(T3 ptXYZ, P3i pointScreen) void
transformPtScrT3
(T3 ptXYZ, T3 pointScreen) void
transformPtScrT32D
(T3 v, P3 pt) transformPtVib
(P3 ptXYZ, Vibration v) void
translateToPercent
(char type, float percent) float
unscaleToScreen
(float z, float screenDistance) void
unTransformPoint
(T3 screenPt, T3 coordPt) boolean
xyzIsSlabbedInternal
(T3 ptRef) protected void
zoomBy
(int pixels) standard response to user mouse vertical shift-dragvoid
zoomToPercent
(float percentZoom) int
zValueFromPercent
(int zPercent)
-
Field Details
-
vwr
-
DEFAULT_VISUAL_RANGE
public static final float DEFAULT_VISUAL_RANGE- See Also:
-
DEFAULT_STEREO_DEGREES
public static final int DEFAULT_STEREO_DEGREES- See Also:
-
MODE_STANDARD
public static final int MODE_STANDARD- See Also:
-
MODE_NAVIGATION
public static final int MODE_NAVIGATION- See Also:
-
MODE_PERSPECTIVE_PYMOL
public static final int MODE_PERSPECTIVE_PYMOL- See Also:
-
movetoThread
-
vibrationThread
-
spinThread
-
degreesPerRadian
public static final double degreesPerRadian- See Also:
-
perspectiveModel
protected int perspectiveModel -
cameraScaleFactor
protected float cameraScaleFactor -
referencePlaneOffset
public float referencePlaneOffset -
aperatureAngle
protected float aperatureAngle -
cameraDistanceFromCenter
protected float cameraDistanceFromCenter -
modelCenterOffset
public float modelCenterOffset -
modelRadius
public float modelRadius -
modelRadiusPixels
public float modelRadiusPixels -
matrixTemp
-
vectorTemp
-
haveNotifiedNaN
protected boolean haveNotifiedNaN -
spinX
public float spinX -
spinY
public float spinY -
spinZ
public float spinZ -
spinFps
public float spinFps -
isSpinInternal
public boolean isSpinInternal -
isSpinFixed
public boolean isSpinFixed -
doTransform4D
protected boolean doTransform4D -
fixedRotationOffset
-
fixedRotationCenter
-
perspectiveOffset
-
perspectiveShiftXY
-
fixedRotationAxis
-
internalRotationAxis
-
internalTranslation
-
matrixRotate
-
matrixTemp3
-
MAXIMUM_ZOOM_PERCENTAGE
public static final int MAXIMUM_ZOOM_PERCENTAGE- See Also:
-
fixedTranslation
-
camera
-
cameraSetting
-
prevZoomSetting
protected float prevZoomSetting -
previousX
public float previousX -
previousY
public float previousY -
zoomEnabled
public boolean zoomEnabled -
zmPct
public float zmPctzoom percent zmPct is the current displayed zoom value, AFTER rendering; may not be the same as zmPctSet, particularly if zoom is not enabled -
slabEnabled
public boolean slabEnabled -
zShadeEnabled
public boolean zShadeEnabled -
internalSlab
public boolean internalSlab -
slabValue
public int slabValue -
depthValue
public int depthValue -
zSlabPercentSetting
public int zSlabPercentSetting -
zDepthPercentSetting
public int zDepthPercentSetting -
zSlabPoint
-
zSlabValue
public int zSlabValue -
zDepthValue
public int zDepthValue -
perspectiveDepth
public boolean perspectiveDepth -
scale3D
protected boolean scale3D -
cameraDepth
protected float cameraDepth -
cameraDepthSetting
protected float cameraDepthSetting -
visualRangeAngstroms
public float visualRangeAngstroms -
cameraDistance
public float cameraDistance -
width
public int width -
height
public int height -
screenPixelCount
public int screenPixelCount -
scaleDefaultPixelsPerAngstrom
public float scaleDefaultPixelsPerAngstrom -
antialias
protected boolean antialias -
matrixTransform
-
matrixTransformInv
-
fScrPt
-
iScrPt
-
mode
public int mode -
defaultMode
public int defaultMode -
untransformedPoint
-
ptTest1
-
ptTest2
-
ptTest3
-
aaTest1
-
matrixTest
-
spinOn
public boolean spinOn -
vibrationOn
public boolean vibrationOn -
vibrationPeriodMs
public int vibrationPeriodMs -
matrixStereo
-
windowCentered
public boolean windowCentered -
bsFrameOffsets
-
NAV_MODE_IGNORE
public static final int NAV_MODE_IGNORE- See Also:
-
NAV_MODE_ZOOMED
public static final int NAV_MODE_ZOOMED- See Also:
-
NAV_MODE_NONE
public static final int NAV_MODE_NONE- See Also:
-
NAV_MODE_RESET
public static final int NAV_MODE_RESET- See Also:
-
NAV_MODE_NEWXY
public static final int NAV_MODE_NEWXY- See Also:
-
NAV_MODE_NEWXYZ
public static final int NAV_MODE_NEWXYZ- See Also:
-
NAV_MODE_NEWZ
public static final int NAV_MODE_NEWZ- See Also:
-
zoomFactor
public float zoomFactor
-
-
Constructor Details
-
TransformManager
public TransformManager()
-
-
Method Details
-
homePosition
public void homePosition(boolean resetSpin) -
setRotation
-
resetRotation
public void resetRotation() -
rotateXYBy
-
rotate3DBall
-
rotateXRadians
-
rotateYRadians
-
rotateZRadians
public void rotateZRadians(float angleRadians) -
rotateAxisAngle
-
rotateAxisAngleRadiansFixed
-
rotateAxisAngleRadiansInternal
-
centerAt
-
percentToPixels
public int percentToPixels(char xyz, float percent) -
setCamera
public void setCamera(float x, float y) -
translateToPercent
public void translateToPercent(char type, float percent) -
getTranslationXPercent
public float getTranslationXPercent() -
getTranslationYPercent
public float getTranslationYPercent() -
getTranslationScript
-
getRotationQ
-
getRotation
-
setZoomHeight
public void setZoomHeight(boolean zoomHeight, boolean zoomLarge) -
zoomBy
protected void zoomBy(int pixels) standard response to user mouse vertical shift-drag- Parameters:
pixels
-
-
zoomToPercent
public void zoomToPercent(float percentZoom) -
setSlabRange
public void setSlabRange(float value) -
slabReset
public void slabReset() -
getSlabPercentSetting
public int getSlabPercentSetting() -
slabToPercent
public void slabToPercent(int percentSlab) -
depthToPercent
public void depthToPercent(int percentDepth) -
slabInternal
-
setSlabDepthInternal
public void setSlabDepthInternal(boolean isDepth) set internal slab or depth from screen-based slab or depth- Parameters:
isDepth
-
-
getCameraFactors
This method returns data needed by the VRML, X3D, and IDTF/U3D exporters. It also should serve as a valuable resource for anyone adapting Jmol and wanting to know how the Jmol 11+ camera business works.- Returns:
- a set of camera data
-
getPerspectiveDepth
public boolean getPerspectiveDepth() -
setCameraDepthPercent
public void setCameraDepthPercent(float percent, boolean resetSlab) either as a percent -300, or as a float 3.0 note this percent is of zoom=100 size of model- Parameters:
percent
-resetSlab
-
-
getCameraDepth
public float getCameraDepth() -
defaultScaleToScreen
public float defaultScaleToScreen(float radius) -
scaleToScreen
public float scaleToScreen(int z, int milliAngstroms) -
unscaleToScreen
public float unscaleToScreen(float z, float screenDistance) -
scaleToPerspective
public float scaleToPerspective(int z, float sizeAngstroms) -
finalizeTransformParameters
public void finalizeTransformParameters() -
getZoomSetting
public float getZoomSetting() -
calcSlabAndDepthValues
public 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 -
zValueFromPercent
public int zValueFromPercent(int zPercent) -
calcTransformMatrix
public void calcTransformMatrix() -
rotatePoint
-
getScreenTemp
-
transformPtScr
-
transformPtScrT3
-
transformPt3f
-
transformPtNoClip
-
transformPt
CAUTION! returns a POINTER TO A TEMPORARY VARIABLE- Parameters:
ptXYZ
-- Returns:
- POINTER TO point3iScreenTemp
-
transformPtVib
- Parameters:
ptXYZ
-v
-- Returns:
- POINTER TO TEMPORARY VARIABLE (caution!) point3iScreenTemp
-
getVibrationPoint
return- Parameters:
v
-pt
- temporary value; also returnedscale
-- Returns:
- pt
-
transformPt2Df
-
transformPtScrT32D
-
transformPt2D
-
xyzIsSlabbedInternal
-
isInPosition
-
moveToPyMOL
-
setAll
-
stopMotion
public void stopMotion() -
getMoveToText
-
setSpinOn
public void setSpinOn() -
setSpinOff
public void setSpinOff() -
setVibrationPeriod
public void setVibrationPeriod(float period) sets the period of vibration -- period > 0: sets the period and turns vibration on -- period invalid input: '<' 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
-
-
setVibrationT
public void setVibrationT(float t) -
isWindowCentered
public boolean isWindowCentered() -
setRotationRadius
public float setRotationRadius(float angstroms, boolean doAll) -
moveRotationCenter
-
setCenterAt
-
calcCameraFactors
public void calcCameraFactors()sets all camera and scale factors needed by the specific perspective model instantiated -
getPerspectiveFactor
public float getPerspectiveFactor(float z) calculate the perspective factor based on z- Parameters:
z
-- Returns:
- perspectiveFactor
-
unTransformPoint
-